Commit Graph

65613 Commits

Author SHA1 Message Date
Vadim Zeitlin
caa270a1af Bring Mac wxDataViewCtrl::GetItemRect() in sync with other ports
Return empty rectangle if the item is not currently visible, for
whatever reason, and use physical coordinates for the rectangle origin.

This makes the unit test for GetItemRect() pass under macOS too.
2018-11-06 04:17:27 +01:00
Vadim Zeitlin
767639276f Disable failing wxDataViewCtrl::IsExpanded() test under Mac
For some unfathomable reason IsExpanded() returns wrong value for one of
the items. This should be fixed, but for now just leave a warning in the
test but don't fail it.

Also document this bug to at least spare people some surprises.
2018-11-06 04:03:34 +01:00
Vadim Zeitlin
bfe11f233f Really implement wxGCDC::GetPPI()
Return the DPI of the associated window, if any, instead of the
hard-coded 72*72.
2018-11-06 03:36:53 +01:00
Vadim Zeitlin
d5c43831b5 Really implement wxGraphicsContext::GetDPI()
Return the DPI of the associated window, if any, instead of always
returning hard-coded 72*72.
2018-11-06 03:36:53 +01:00
Vadim Zeitlin
5e53b22bd4 Add wxGraphicsContext::GetWindow()
This method allows to retrieve the window this context is associated
with, if any.

Add "wxWindow*" argument to wxGraphicsContext ctor and provide the
window pointer to it when available, i.e. when creating the context from
a wxWindow directly or from wxWindowDC, which is also associated with a
window, in platform-specific code.

No real changes yet.
2018-11-06 03:36:53 +01:00
Artur Wieczorek
d735e444f1 Refer to wxPGProperty associated with wxPGComboBox editor in all drawing operations
Store wxPGProperty for which wxPGComboBox editor is activated and use
this reference in all further drawing operations instead of retrieving
each time currently selected wxPGProperty which during the entire
lifetime of the editor is the same as property selected on editor
activation.

See #18211.
2018-11-05 22:38:39 +01:00
Vadim Zeitlin
190601c47f Translate the warning shown by wxHyperlinkCtrl::SendEvent()
As anything shown to the user, this string must be translated, so use
_() around it instead of wxT().

Also reword the string a little; remove unnecessary call to .c_str() and
use a const reference instead of making a copy of the URL unnecessarily.
2018-11-05 19:38:18 +01:00
Vadim Zeitlin
3e246c767f Return true from wxHyperlinkCtrl::MSWOnNotify()
As SendEvent() not only sends the event about clicking on the link, but
also opens the link in the default browser if this event was not
processed (which wasn't really obvious from its name, so at least
mention it in its comment), the event is actually always handled and so
MSWOnNotify() must return true, not false (and definitely not 0) to
indicate it.

Closes #18266.
2018-11-05 19:35:44 +01:00
Vadim Zeitlin
ef92b92691 Add unit test for wxCTZ
Check that the new function works reasonably correctly.
2018-11-05 19:27:53 +01:00
Vadim Zeitlin
1c68979fb4 Move wxCTZ() documentation to the appropriate place
The documentation comment belongs to interface/wx/math.h, not the header
under include.

Also change the argument type to wxUint32 as the non-gcc version only
works for 32 bit values.
2018-11-05 19:27:53 +01:00
Vadim Zeitlin
b00a24af60 Document wxJoystickEvent event changes
In particular, list the incompatible change in the corresponding section
and explain how to update the existing code.
2018-11-05 19:27:53 +01:00
Vadim Zeitlin
4198107086 Fix wxJoystickEvent documentation after the last commit
Remove left over part of the old sentence.

Also add a link to GetButtonChange() to GetButtonOrdinal()
documentation.
2018-11-05 19:27:53 +01:00
Mick Phillips
291a880d0c Synchronize joystick events between all ports
Generate wxJoystickEvent with the same fields under all platforms by
making the Linux and macOS versions follow MSW convention of using
"1 << N" for the changed button.

Add GetButtonOrdinal() accessor which can be used to retrieve just N.

Closes #18233.
2018-11-05 19:27:36 +01:00
Vadim Zeitlin
cf980cf5e3 Merge branch 'cmake-gstreamer-d2d' of https://github.com/MaartenBent/wxWidgets
CMake improvements: better gstreamer and Direct2D support.

See https://github.com/wxWidgets/wxWidgets/pull/1014
2018-11-05 18:51:10 +01:00
Artur Sochirca
fdee5e7bc9 Replace another occurrence of deprecated wxUSE_GENERICDATAVIEWCTRL
Use wxHAS_GENERIC_DATAVIEWCTRL instead, to complete the changes of
bc92ed9d85, see
https://github.com/wxWidgets/wxWidgets/pull/827

Closes https://github.com/wxWidgets/wxWidgets/pull/1016
2018-11-05 18:44:59 +01:00
Václav Slavík
aaa13cf520 Fix font description for non-. decimal separators
Fix wxNativeFontInfo::ToString and FromString to work correctly under
locales that don't use '.' for decimal separator. The code incorrectly
parsed descriptions using ToCDouble and this '.', but wrote them out
using locale's native separator. Fixed by using FromCDouble for output
too.
2018-11-05 18:30:09 +01:00
Stefan Csomor
b77aa4782d Forcing paint after show on 10.14
layer-backed views do not get a refresh when shown, but wx-user code might depend on the assumption that they do
2018-11-05 14:37:54 +01:00
Maarten Bent
55c50f36dc Disable webview in static build
Prevent link errors of test_gui with webview libraries.
2018-11-04 23:44:06 +01:00
Maarten Bent
de4eecc575 Install additional packages on Travis CI
Install packages for gstreamer, webkit, opengl and libsecret.
First check if the package is available.
2018-11-04 22:00:32 +01:00
Vadim Zeitlin
1256695d46 Document that wxDataViewCtrl::GetItemRect() now works in wxGTK
Remove the note about it being non-implemented from the docs and mention
this in the change log.
2018-11-04 18:37:54 +01:00
Vadim Zeitlin
bf97715972 Support NULL column in wxDataViewCtrl::GetItemRect() in wxOSX
Emulate support for non-specified column by using the first and, if
necessary, last columns in this case.
2018-11-04 18:35:07 +01:00
Vadim Zeitlin
fad50e74b7 Fix wxDataViewCtrl::GetItemRect() in wxGTK and enable its test
A couple of fixes compared to the previous commit:

- Use the correct gtk_tree_view_get_cell_area() rather than
  gtk_tree_view_get_background_area() which doesn't work correctly
  for the items which are not shown because their parent is collapsed.
- Translate logical coordinates to physical ones using
  gtk_tree_view_convert_bin_window_to_widget_coords().

With these fixes, the unit tests for this function pass and can now be
enabled under wxGTK as well.

See https://github.com/wxWidgets/wxWidgets/pull/990
2018-11-04 18:28:59 +01:00
Umberto Carletti
94a2595f5b Add GTK implementation of wxDataViewCtrl::GetItemRect()
This function returns a wxRect of the given wxDataViewItem. If no column
is provided, the width will be the sum of all the visible columns widths.

See https://github.com/wxWidgets/wxWidgets/pull/990
2018-11-04 18:28:34 +01:00
Vadim Zeitlin
12f8ab20f9 Move operator<<(std::ostream&, wxRect) overload to a header
This will allow reusing it in other tests too.

Also make the output slightly more readable by formatting the rectangle
as "{x,y w*h}" instead of "{x,y,w,h}".

No real changes.
2018-11-04 18:28:33 +01:00
Vadim Zeitlin
9d2ee59138 Update comments in tests/asserthelper.h
No real changes, just avoid mentioning CPPUNIT_ASSERT_EQUAL() in the
comments for the operator<<() overloads as it is used with CATCH too.

Also don't duplicate the same comment 4 times unnecessarily.
2018-11-04 18:28:33 +01:00
Vadim Zeitlin
9460038b3f Return empty rectangle from GetItemRect() if item is not visible
This was already the case if the item was not visible because its parent
was not expanded, but now make it also true for the items which are not
visible due to the current scrollbar position.

Add unit tests checking for this and also verifying that GetItemRect()
returns the coordinates in the physical window coordinates.
2018-11-04 18:28:33 +01:00
Vadim Zeitlin
baf3dda57e Merge branch 'editlbox-fixes'
Cosmetic fixes to wxEditableListBox buttons appearance and some code
modernization.

See https://github.com/wxWidgets/wxWidgets/pull/1012
2018-11-04 17:56:10 +01:00
Vadim Zeitlin
31f5f2dc08 Rename a variable in wxEditableListBox code for clarity
Rename "centered" into "flagsCentered" to make it more obvious that this
variable contains wxSizerFlags.
2018-11-04 17:54:52 +01:00
Vadim Zeitlin
9b7757c44d Ensure that wxDataViewMainWindow has correct size in the test
Replace a redundant (because the same size was already specified in the
ctor) SetSize() call with a Layout() call which resizes
wxDataViewMainWindow to fit the parent control size when using the
generic implementation.

This is important for any tests dealing with the control geometry, i.e.
calling GetItemRect() or HitTest().
2018-11-04 17:49:12 +01:00
Vadim Zeitlin
c3779f2e5d Clarify ItemToRowJob in generic wxDataViewCtrl code
Rename its m_ret field to a more clear and more consistent with
RowToTreeNodeJob::m_current name and also make m_current, unlike m_ret,
0-based from the beginning instead of having to subtract 1 from it in
GetResult().

There should be no changes in the class behaviour.
2018-11-04 17:29:24 +01:00
Vadim Zeitlin
4b8fed3ad6 Make ItemToRowJob::m_item const
No real changes, just indicate that this member variable doesn't change.
2018-11-04 17:21:09 +01:00
Vadim Zeitlin
1f0aad61e2 Use standard naming convention for ItemToRowJob members
Use "m_" prefix for all of them.

No real changes.
2018-11-04 17:20:11 +01:00
Vadim Zeitlin
ed20421181 Clarify RowToTreeNodeJob in generic wxDataViewCtrl code
Get rid of hardcoded, without any explanation, "-2" value passed to this
class ctor and instead initialize its m_current member to -1 and explain
why do we do it and increment it after processing the current item, not
before, in operator().

No changes in behaviour.
2018-11-04 17:17:50 +01:00
Vadim Zeitlin
ada5de3d0d Fix wxDataViewCtrl::GetItemRect() for collapsed items
Calling GetItemRect() for an item which was not currently visible
because its parent was collapsed resulted in silently returning the
value for a wrong value before the recent fix to GetRowByItem() and in
a crash after it because GetTreeNodeByRow() returned null when passed
invalid row index.

Fix this by explicitly checking whether the item is shown and just
returning an empty rectangle instead.

Also document this behaviour and add a unit test for it.
2018-11-04 17:15:42 +01:00
Vadim Zeitlin
31c49caab5 Add unit test for wxDataViewCtrl::IsExpanded()
Check that it returns correct results, both for the currently visible
and hidden items.
2018-11-04 17:10:23 +01:00
Vadim Zeitlin
685f9ff57d Fix bug in GetRowByItem() in generic wxDataViewCtrl
If the item was not found at all, which can happen if all its parents
are not expanded, this function still returned a valid but completely
wrong row index.

This affected many functions which could call it for the items which
were not necessarily visible, i.e. all of them except for the event
handlers as events can only affect the visible items, including but not
limited to SetCurrentItem(), all the selection-related functions, all
the expansion-related functions, EnsureVisible(), HitTest() and
GetItemRect().
2018-11-04 17:03:16 +01:00
Maarten Bent
9554cb49d8 Fix build when enabling wxD2D_DEVICE_CONTEXT_SUPPORTED
Add missing GUID and function for dynamic linking.
2018-11-04 16:49:14 +01:00
Maarten Bent
e1e5169e4b CMake: enable Direct2D graphics context by default
Disable it when the d2d1.h header is not found.
When using MSVC, match the behaviour of setup.h.
2018-11-04 16:49:14 +01:00
Maarten Bent
5c4741430a CMake: move find_package for lzma and secretstore to init.cmake 2018-11-04 16:35:58 +01:00
Maarten Bent
e1b725d5be CMake: mark package variables as advanced
Silence pkg_check_modules message.
2018-11-04 16:35:58 +01:00
Maarten Bent
d293f94d95 CMake: improve finding gstreamer
Support checking for multiple versions, first check gstreamer-1.0, then gstreamer-0.10.
Add support for finding gstreamer-player.
Specify the required components, add the include directories and link with the libraries of the found components.
Set the setup variables wxUSE_GSTREAMER and wxUSE_GSTREAMER_PLAYER.
2018-11-04 16:35:57 +01:00
Vadim Zeitlin
739ce60552 Remove the unused RowToTreeNodeJob::m_parent variable
This variable was assigned to but never used.

Also remove the corresponding ctor argument which was only used to
initialize this unused variable.
2018-11-04 14:58:23 +01:00
Vadim Zeitlin
3d4a47a6bb Change RowToTreeNodeJob::m_row type to int and make it const
It doesn't make much sense to use an "unsigned int" variable only to
cast it to int everywhere where it's used. Just make it "int" from the
get go and have a single cast to int in the caller.

Also make m_row const as it never changes.
2018-11-04 14:56:36 +01:00
Vadim Zeitlin
05ae63e40a Use standard naming convention for RowToTreeNodeJob members
Prefix them with "m_" to indicate that they're member variables.

No real changes.
2018-11-04 14:55:43 +01:00
Vadim Zeitlin
fe865a1743 Rewrite wxDataViewCtrl unit test without using CppUnit macros
Use CATCH API directly, this simplifies the code and makes adding new
tests simpler.

No real changes yet.
2018-11-04 14:34:49 +01:00
Vadim Zeitlin
84d3ee10cc Merge branch 'simplify-imagelist'
Merge Mac-specific and generic wxImageList versions and modernize the
code.

See https://github.com/wxWidgets/wxWidgets/pull/1001
2018-11-04 14:15:16 +01:00
Daniel Kulp
26f0e816ca Send wxEVT_AUINOTEBOOK_PAGE_CHANGED after changing the page
For consistency with the other similar events and because it is more
useful for the code handling it, send this event when the new page is
already shown instead of doing it before showing it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1007
2018-11-03 22:56:15 +01:00
Blake Eryx
65827a0572 Remove unnecessary c_str() calls from the samples
Pass wxStrings directly to wxString::Format("%s") and similar
pseudo-vararg functions, there is no need for c_str() there since
wxWidgets 2.9.

Closes https://github.com/wxWidgets/wxWidgets/pull/1009
2018-11-03 22:52:57 +01:00
Vadim Zeitlin
f24892127d Remove unnecessary wxUSE_TOOLTIPS check in wxEditableListBox code
SetToolTip() is defined (as doing nothing) even if wxUSE_TOOLTIPS==0, so
just call it directly as this allows to save on both the preprocessor
check and the check for the button validity.
2018-11-03 22:45:37 +01:00
Vadim Zeitlin
397b5ff01e Use wxSizerFlags-based API in wxEditableListBox
No real changes, just make the code more clear by using wxSizerFlags.
2018-11-03 22:43:10 +01:00