Commit Graph

64583 Commits

Author SHA1 Message Date
Maarten Bent
bfee89e3c4 CMake: Auto-enable wxUSE_STD_CONTAINERS when wxUSE_STL is enabled 2018-07-29 16:26:42 +02:00
Maarten Bent
a156cb5b6b CMake: Update cotire to version 1.8.0 2018-07-29 16:26:41 +02:00
Maarten Bent
a5b1a418bb Use wxPrintf in interactive tests
Remove unneeded calls to c_str() and mb_str().
2018-07-29 16:26:41 +02:00
Maarten Bent
57180d68c8 Add wxOVERRIDE to test files
And cleanup some tailing spaces and tabs.
2018-07-29 12:08:53 +02:00
Stefan Csomor
56a51ad1e7 fixing non-precompiled header build, adding method body 2018-07-28 20:14:26 +02:00
Stefan Csomor
342e445423 Adding wrapper for Core Foundation dictionaries 2018-07-28 17:49:42 +02:00
Stefan Csomor
d08033292c correcting doc 2018-07-28 15:28:45 +02:00
Artur Wieczorek
52d0462aa5 Fix closing empty subpath (Core Graphics)
CGPathCloseSubpath() shouldn't be invoked if the path is empty to suppress harmless warning displayed on console.
2018-07-28 14:19:33 +02:00
Artur Wieczorek
3f18576dee Apply workaround in creating wxGraphicContext from native DC only for Cairo < 1.15.12 (wxMSW).
Cairo bug 96482 was fixed in 1.15.12 so the workaround needs to be applied
only for older Cairo versions.
2018-07-28 12:20:26 +02:00
Artur Wieczorek
c948e1e15e Fix retrieving empty bounding box for Core Graphics graphics path
Return "zero" rectangle if bounding box is empty
2018-07-28 11:48:21 +02:00
Artur Wieczorek
c8fe811636 Fix wxGraphicsPath::MoveToPoint for Direct2D
Calling MoveToPoint() shouldn't automatically open a new D2D figure (which
acts as a subpath) because in case of consecutive calls to MoveToPoint()
every next call would close the figure opened by the previous call and
we would get spurious figure(s) (consisting one point).
Opening a D2D figure (subpath) should be delgated to the functions doing
actual drawing.
2018-07-28 11:46:28 +02:00
Artur Wieczorek
74306708bc Fix retrieving empty bounding box for D2D graphics path
Return "zero rectangle" (0, 0, 0, 0) if bounding box is empty.
2018-07-28 11:43:31 +02:00
Artur Wieczorek
e25ab3e421 Fix getting extents of wxGraphicsPath (Cairo)
Graphics path is actually a line with null width so its bounding box
should be obtained with cairo_path_extents() function which assumes
that line width is 0.
2018-07-28 11:41:07 +02:00
Artur Wieczorek
e732da462f Add tests for the bounds of wxGraphicsPath
Check if bounding box of wxGraphicsPath is properly determined.
2018-07-28 11:36:44 +02:00
Vadim Zeitlin
4af7d4e0d5 Also implement wxDataViewColumn::UnsetAsSortKey() for wxGTK
Allow to reset the sort order in native GTK+ implementation too.

See #18176.
2018-07-28 02:54:44 +02:00
Daniel Kulp
2a59c1fb20 Implement wxDataViewColumn::UnsetAsSortKey() in macOS version
It was impossible to stop sorting the control if it had been sorted
before, so implement UnsetAsSortKey() to allow doing it by destroying
the current sort descriptor.

Closes #18176.
2018-07-28 02:29:30 +02:00
Vadim Zeitlin
5d091e0962 Avoid harmless warning about using nil in wxMac wxNotebook code
At least with 10.12 SDK, NSTabViewItem initWithIdentifier: parameter
isn't annotated as being nullable, so passing "nil" to it triggers a
compiler warning.

This warning is apparently harmless and the header was fixed in 10.13
SDK, so just suppress it.
2018-07-28 02:26:45 +02:00
Vadim Zeitlin
a3f6456f55 Test wxDataViewColumn::UnsetAsSortKey() in dataview sample
Add a checkbox to test the behaviour of SetSortOrder() and
UnsetAsSortKey() methods in the sample.
2018-07-28 02:17:15 +02:00
Paul Cornett
3ec4e53aa1 Avoid setting "pending" focus to a window which already has the focus. 2018-07-26 09:21:03 -07:00
Vadim Zeitlin
1345b38c51 Merge branch 'gtk-datapick-focus'
Fix focus event generation for generic wxDatePickerCtrl and other
wxCompositeWindows.

See https://github.com/wxWidgets/wxWidgets/pull/860

Closes #18120.
2018-07-25 20:15:32 +02:00
Vadim Zeitlin
4059f24cf5 Reset pending focus when losing focus in wxGTK
It could happen that the window remained as the global "pending focus"
even after it lost its focus, resulting in FindFocus() still returning
it as the currently focused window, even though it didn't have focus any
more.

This notably broke focus logic of wxCompositeWindow and could result in
missing wxEVT_KILL_FOCUS for windows using it, such as wxDatePickerCtrl,
and quite likely was responsible for other focus problems in wxGTK as
well.
2018-07-25 18:18:18 +02:00
Vadim Zeitlin
c9cce7e071 Refactor focus debug logging in wxGTK
No real changes, just add a helper wxDumpWindow() function to make focus
logging less verbose and slightly more readable (as the label is not
shown any more if it's empty).
2018-07-25 18:18:18 +02:00
Vadim Zeitlin
25a2bae836 Test focus event generation for all pages of the widgets sample
Previously this was done only for wxSearchCtrl, extend this now to all
the widgets in order to be able to check whether the expected events are
generated.
2018-07-25 18:18:18 +02:00
Vadim Zeitlin
fb71adab04 Add a unit test for wxDatePickerCtrl focus events
Unfortunately it doesn't work with wxGTK, as usual, due to
wxUIActionSimulator not working correctly there.
2018-07-25 18:18:18 +02:00
Vadim Zeitlin
06d2b836a0 Bind focus events to direct children only in wxCompositeWindow
Previously, wxEVT_{SET,KILL}_FOCUS event handlers were connected to all
children, even the indirect ones, which resulted in duplicate focus
events if a grandchildren forward its focus event to its parent window,
as happens e.g. with wxComboCtrl, which contains a text control that
forwards its focus events to the containing control itself.

This change seems globally sound, even if it might break some controls
whose children don't get the expected focus events themselves, because
the right thing to do is to fix those children. And it fixes duplicate
focus events in wxDatePickerCtrlGeneric.
2018-07-25 14:11:17 +02:00
Vadim Zeitlin
ef4494cdca Merge branch 'html-page-break-inside'
Add support for style="page-break-inside:avoid" to wxHTML.

See https://github.com/wxWidgets/wxWidgets/pull/837
2018-07-25 13:54:29 +02:00
Vadim Zeitlin
9e05eb42b5 Fix outdated comment in wxHtmlPrintout unit test
This should have been part of 321854b519
which changed the code, but not the accompanying comment.
2018-07-25 13:52:49 +02:00
Vadim Zeitlin
0338796847 Remove unnecessary headers from wxHtmlPrintout unit test
These headers were added by 905789485a
which was replaced with 321854b519 later
and are not needed any more.
2018-07-25 13:49:00 +02:00
Vadim Zeitlin
78edf14c88 Revert "Add temporary debugging code for HTML pagination test failure"
This reverts commit 0393940033 which is
not needed any longer after fixing AppVeyor test failure.
2018-07-25 13:47:43 +02:00
Vadim Zeitlin
6acd663190 Revert "Add even more debug output to the test"
This reverts commit 1ce009e73a as AppVeyor
test failures problem is fixed now.
2018-07-25 13:47:13 +02:00
Vadim Zeitlin
542124aa95 Fix page-break-inside:avoid to work for nested tags too
The initial version was too naïve and didn't work correctly if the <div>
with this style had nested elements.
2018-07-25 02:23:02 +02:00
Vadim Zeitlin
021725ce76 Dispatch all events pending at wx level before exiting event loop
This amends a0298f3149 by only avoiding
dispatching of the native events in nested event loops, but still
dispatching any pending wx-level events before exiting it.

The latest code still solves the original problem, as it was due to
having an endless stream of native events, without possibly introducing
new problems and even crashes if, for example, some dialog event handler
queued an event referencing the dialog itself for later procession, as
this event must be dispatched before the loop exits and the dialog is
destroyed, which wasn't the case any more after the changes of
a0298f3149 but is done again now.

See #11273.
2018-07-24 16:03:12 +02:00
Vadim Zeitlin
a024c802b1 Avoid warnings from gtk.h in the widgets sample
Ignore -Wparentheses given by g++ 8 for some GTK+ 3 versions (e.g.
3.22.30 currently in Debian Sid).
2018-07-24 15:27:31 +02:00
Vadim Zeitlin
187d719071 Update comment in wxListBox::MacHandleSelectionChange()
Don't mention GetOldSelection() function that was removed by
dde6f662fc to avoid confusion.

See #15603.
2018-07-24 15:26:45 +02:00
Vadim Zeitlin
4e7b21cd72 Merge branch 'mac-def-bmpbtn-margins'
Stop using wxBU_AUTODRAW under Mac and everywhere else.

See https://github.com/wxWidgets/wxWidgets/pull/859

Closes #18170.
2018-07-24 15:17:32 +02:00
Vadim Zeitlin
90edeace90 Merge branch 'ansi-fix'
Fix wxMSW compilation errors in non-Unicode build.

See https://github.com/wxWidgets/wxWidgets/pull/858

Closes #18172.
2018-07-24 15:15:28 +02:00
Vadim Zeitlin
98eec2646e Merge branch 'mingw-w64-warn-fixes'
Fix a few (harmless) warnings when building with gcc 8 from MinGW-w64.

See https://github.com/wxWidgets/wxWidgets/pull/854
2018-07-24 15:14:09 +02:00
Jouk
8e5afcafa4 Remove libxinerama from linking on OpenVMS 2018-07-24 14:13:29 +02:00
pavel-t
5994248648 Keep actual number of allocated lines in numLines 2018-07-23 09:21:40 +03:00
pavel-t
58f0fd65fe Store info_ptr and png_ptr in wxPNGImageData
Avoid having to use goto in DoLoadPNGFile and have all clean-ups in wxPNGImageData destructor.
2018-07-23 09:01:56 +03:00
pavel-t
e3df636d82 Make DoLoadPNGFile member function of wxPNGImageData
Avoid adding "data." everywhere in DoLoadPNGFile code
2018-07-23 08:33:10 +03:00
Vadim Zeitlin
97e217e175 Ensure that wxDatePickerCtrlGeneric does get focus events
Revert 1de107c037 and remove the focus
event handler which duplicated and interfered with the handler inherited
from this class to make sure that we get wxEVT_{SET,KILL}_FOCUS for the
objects of this class.

Unfortunately these events now come in pairs, due to an extra artificial
event generated by wxComboBoxExtraInputHandler::OnFocus(), which is
still wrong -- but arguably less wrong and more useful than not sending
them at all.
2018-07-22 19:12:17 +02:00
Vadim Zeitlin
321854b519 Try using fixed font size in pixels in the test 2018-07-22 00:54:05 +02:00
Vadim Zeitlin
1ce009e73a Add even more debug output to the test 2018-07-22 00:43:26 +02:00
Vadim Zeitlin
96cca10328 Use fixed font name in the HTML pagination test 2018-07-22 00:43:26 +02:00
Vadim Zeitlin
0393940033 Add temporary debugging code for HTML pagination test failure 2018-07-22 00:43:26 +02:00
Vadim Zeitlin
905789485a Fix the just added pagination test for high DPI systems
Adjust the font size used by a DPI-dependent factor to ensure that the
text takes the same amount of pixels independently of DPI.
2018-07-22 00:43:25 +02:00
Vadim Zeitlin
566e401a3f Add support for style="page-break-inside:avoid" to wxHTML
Allow using this style to prevent page breaks inside the given <div>.
2018-07-22 00:43:25 +02:00
orbitcowboy
8dfd799fd5 Use const for constant local variables in wxWidgets headers
This avoids warnings from MSVS 2017 static analyzer when C++ core rule
set is activated.

Closes https://github.com/wxWidgets/wxWidgets/pull/819
2018-07-21 16:16:32 +02:00
Vadim Zeitlin
e24e9323e0 Fix clobbering warnings in PNG image loading code in a better way
Add wxPNGImageData and use it to store variables that used to be local
in wxPNGHandler::LoadFile() and could be clobbered by the use of
longjmp() and pass these variables to DoLoadPNGFile(), which still uses
longjmp(), whereas LoadFile() doesn't any longer.

In addition to fixing the warning, this allows to use C++ dtors for
freeing memory and makes the code shorter and, arguably, more clear than
the original version (although written in an unusual way) and definitely
more clear than the version with the warning fix.

This reverts commit 99ea06203a ("Fix
clobbering warning") and replaces it with a different solution to the
same problem.
2018-07-21 16:00:08 +02:00