Commit Graph

65373 Commits

Author SHA1 Message Date
Artur Wieczorek
f3b6e6d3b5 Fix date format specification in wxDatePickerCtrlGeneric with wxUSE_INTL=0
Conversion specification for preferred date representation is "%x", not "x".
2018-11-10 14:59:27 +01:00
Artur Wieczorek
41898c8dc4 Compilation fix for wxUSE_INTL=0 build 2018-11-10 14:49:52 +01:00
Vadim Zeitlin
664b8c153f Don't export sorted dynamic arrays from the shared library
This shouldn't be necessary and doing it seems to result in duplicate
symbol errors when using MSVC under some not completely elucidated
circumstances.

See https://github.com/utelle/wxpdfdoc/pull/48

Closes https://github.com/wxWidgets/wxWidgets/pull/1013
2018-11-10 12:17:53 +01:00
Vadim Zeitlin
463deb03c9 Merge branch 'gtk-dpi'
A bunch of improvements for per-monitor DPI support in wxGTK and
wxGraphicsContext more generally.

Closes https://github.com/wxWidgets/wxWidgets/pull/995
2018-11-10 12:15:27 +01:00
VZ
cce9ef9d53 Fix compatibility breakage with wxMask::Create() in wxOSX (#1019)
Defining a Mac-specific Create(wxMemoryBuffer) overload hid the other
Create() overloads, which are actually part of the public API, so they
couldn't be used any longer since the changes of
e7d21f6638

Fix this by renaming this Create() to OSXCreate(), to avoid hiding the
base class methods.

Also remove Mac-specific ctor taking wxMemoryBuffer, this is confusing
and can be avoided by just calling OSXCreate() directly in the only
place where it is used.
2018-11-09 17:52:58 +01:00
Stefan Csomor
e484a2db19 force subview refresh on macOS 10.14
even on dark mode not all NSViews have their own layer, therefore don’t take that as a condition, because a child of such a view still might be layer-backed and need an explicit redraw.
Avoid spurious redraws for not visible windows (especiall important for not-yet fully constructed views or views during destruction)
2018-11-08 15:04:42 +01:00
Artur Wieczorek
bf3cfe16d4 Remove irrelevant TODO note from documentation
Function is marked as deprecated so TODO note is no longer relevant.
2018-11-07 22:25:19 +01:00
Artur Wieczorek
9e378480c2 Iterate over all characters of a wxString with iterator 2018-11-07 22:12:56 +01:00
Vadim Zeitlin
3d18e1a2b4 Merge branch 'joystick-fixes'
Harmonize joystick events between different platforms.

See https://github.com/wxWidgets/wxWidgets/pull/1017
2018-11-07 18:33:26 +01:00
Paul Cornett
8929b3d3de Use a more robust check for the GNU C Library
_GNU_SOURCE alone is not definitive
2018-11-05 21:09:13 -08:00
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