Commit Graph

71396 Commits

Author SHA1 Message Date
Vadim Zeitlin
d01760ae41 Ignore apt-get update error in Travis CI build
For now just ignore it, it might be better to prune the repositories we
don't need, such as https://downloads.apache.org/cassandra/debian, which
result in the errors.
2021-04-12 21:04:21 +02:00
Vadim Zeitlin
329f60d7f3 Factor out wxTopLevelWindowGTK::GTKDoAfterShow()
Just extract the code generating wxEVT_SHOW for TLWs in wxGTK in its own
function before modifying it to avoid having to do it in two places.

No real changes, this is a pure refactoring.
2021-04-12 17:27:34 +02:00
Vadim Zeitlin
ed23b47695 Merge branch 'build-docs'
Improve installation and build documentation.

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

Closes #18720.
2021-04-11 17:34:39 +02:00
Vadim Zeitlin
cf01fe536d Don't call wxYield() after key release in wxUIActionSimulator
This breaks existing unit tests using wxUIActionSimulator that do things
similar to

	wxUIActionSimulator sim;
	sim.Char('o', wxMOD_CMD);
	wxTEST_DIALOG(wxYield(), ... expected "Open" dialog ...);

because the expected dialog would be shown from inside Char(), unlike
with the wxMSW implementation and GTK until the changes of 59ad9f46e6
(Make wxUIActionSimulator works more reliably on GTK/X11, 2020-05-07).

To still make sure there is a delay after the event, sleep, if
necessary, before simulating the next event: this is still enough for wx
test suite to pass, but allows the code like above to work with both
wxMSW and wxGTK.

In fact, doing it like this makes the code simpler and removes the need
to distinguish between press and release events or maintaining the
number of currently simulated-as-depressed buttons or keys, so it also
simplifies things as a side effect.

Also add some comments and rename Default_Delay constant to a more
accurately named MIN_DELAY_BETWEEN_EVENTS.

Closes https://github.com/wxWidgets/wxWidgets/pull/2318
2021-04-11 17:34:05 +02:00
Vadim Zeitlin
c82ff381f5 Suppress memory leak reports from GTK CSS drawing functions
We don't seem to be doing anything wrong, but ASAN detects many such
leaks as soon as we call functions such as gtk_css_style_render_icon()
(used by wxRendererGTK::DrawCheckBox()) and several others.
2021-04-11 17:34:05 +02:00
Vadim Zeitlin
8620c6e9fd Update dates and version numbers for 3.1.5 release
Also invalidate SHA-1 sums for the release files.
2021-04-11 17:28:16 +02:00
Vadim Zeitlin
39c0277942 Update README and announcement for 3.1.5
Link to the installation instructions from the README instead of
repeating them.

Also eliminate gratuitous differences between the two files.
2021-04-11 17:28:16 +02:00
Vadim Zeitlin
c64a908472 Transfer git notes since 3.1.4 to the actual change log
Also fix the release date.
2021-04-11 17:28:15 +02:00
Vadim Zeitlin
b671d230f2 Merge remote-tracking branch 'MaartenBent/bitmap_cursor_osx'
Add wxBitmap(const wxCursor &cursor) constructor to wxOSX.

See https://github.com/wxWidgets/wxWidgets/pull/2314
2021-04-11 16:46:58 +02:00
Vadim Zeitlin
8f0045b3a6 Add "Verifying the Installation" section
Briefly explain how to check that wxWidgets is installed correctly.

This is again redundant with the information already present elsewhere,
but it seems worth repeating it here.
2021-04-11 16:21:57 +02:00
Vadim Zeitlin
b963ce0583 Add new "Installation" page to the manual
Currently this simply links to the existing port-specific installation
instructions, but this should provide a less confusing and more
prominent entry point than the existing topics.
2021-04-11 14:29:21 +02:00
Vadim Zeitlin
cf2bb21885 Add a note about using ranged-based for loop with wxString
It is surprising that "for (auto& c: s)" doesn't compile, so document
this and propose a replacement.

Do not document the fact that "for (auto c: s)" actually allows to
modify the string via "c" (which is still wxUniCharRef) as this is
probably just going to confuse people more than help.
2021-04-11 13:24:33 +02:00
Vadim Zeitlin
c5ab151a72 Rename and reorder "Important wxWidgets Topics" section
Events and sizing is more important than Unicode or i18n, so put them
first.

Also "important" doesn't really mean anything, so use a hopefully more
clear section name.
2021-04-11 13:15:36 +02:00
Vadim Zeitlin
80f33c0c8c Order topics of "Starting" section in more logical order
In particular, put "notes" at the end of this section instead of the
very beginning as it's definitely not the most important part here.
2021-04-11 13:14:27 +02:00
Maarten Bent
3a27830ed5 Account for different size in bitmap from cursor test
Use already existing wx.png to test the cursor.
Compare alpha channel of images.
2021-04-10 15:26:10 +02:00
Igor Korot
0c82830a5d Add test for creating bitmap from cursor 2021-04-10 14:17:48 +02:00
Igor Korot
9394d26c40 Implement wxBitmap(const wxCursor&) constructor for OSX 2021-04-10 14:17:27 +02:00
Vadim Zeitlin
cace392627 Merge branch 'msw-text-ctrl-backspace'
Implement support for Ctrl+Backspace for all MSW text controls.

See https://github.com/wxWidgets/wxWidgets/pull/2317
2021-04-09 17:29:14 +01:00
Artur Wieczorek
de10f054c4 Improve calculating wxButton best size under wxMSW
We can use BCM_GETIDEALSIZE message to get the size of the button that
best fits its text and image (if present).
It gives better results for text wxButton with wxBU_EXACTFIT style.
2021-04-08 19:26:12 +02:00
Vadim Zeitlin
a02690f957 Merge branch 'mac-dvc-autosize'
Fixes for wxDVC columns autosizing under Mac.

See https://github.com/wxWidgets/wxWidgets/pull/2305
2021-04-08 01:39:21 +02:00
Vadim Zeitlin
6a49524a94 Remove unused scale factor parameter in wxD2DOffsetHelper ctor
This was added 52cc838b12 (Implement 0-width pen consistently in
wxGraphicsContext, 2021-04-05) but doesn't seem useful and, in fact, was
not used at all in the constructor body, resulting in an unused
parameter warning, so just remove it.

No real changes.
2021-04-08 00:38:22 +01:00
Vadim Zeitlin
1248829802 Implement support for Ctrl+Backspace in plain EDIT controls
This shortcut is undocumented, but works in rich edit controls and even
in plain ones if they use SHAutoComplete(), so support it in all
controls because this is what people expect.
2021-04-08 00:26:41 +01:00
Artur Wieczorek
5e8bb6f2e7 Fix converting wxImage with alpha channel and mask to wxBitmap (wxGTK2)
Since f7247086c2 ("Fix storing wxBitmap data in GdkPixbuf", 2019-09-18),
919a4ec702 ("Fix drawing wxBitmap with mask", 2019-09-18) and other
commits (see #18498, #18508) RGBA wxBitmaps with masks are drawn properly
under wxGTK2 so if source wxImage has both alpha channel and a mask
the target wxBitmap also should have both components.
2021-04-08 00:03:10 +02:00
Artur Wieczorek
c97bec76b8 Fix converting wxBitmap to wxImage (wxGTK2)
Since f7247086c2 ("Fix storing wxBitmap data in GdkPixbuf", 2019-09-18),
919a4ec702 ("Fix drawing wxBitmap with mask", 2019-09-18) and other
commits (see #18498, #18508) RGBA wxBitmaps with masks are drawn properly
under wxGTK2 so only wxBitmap raw RGBA data should be transferred to
wxImage RGBA data because mask is stored in the target wxImage separately.
2021-04-08 00:02:13 +02:00
Vadim Zeitlin
1007259504 Add wxTextEntry::MSWUsesStandardAutoComplete()
Implementation is a hack, using a magic pointer value because just
storing this in wxTextAutoCompleteData is not simple, as any flag added
to it would need to be reset in several different places.

This is not used yet, but will be in the upcoming commits.
2021-04-07 22:27:24 +01:00
Vadim Zeitlin
a6e4cc7eb0 Refactor wxTextEntry to use MSWEnsureHasAutoCompleteData()
The new function has more clear semantics than GetOrCreateCompleter()
which both returned the completer value and set m_autoCompleteData to it
as a side effect. MSWEnsureHasAutoCompleteData() still does the latter,
but returns just a boolean indicating whether it succeeded or failed,
making using it more straightforward.

No real changes.
2021-04-07 22:20:05 +01:00
Vadim Zeitlin
5f33a52f49 Merge branch 'ci-tests-fixes'
Minor fixes and improvements for the tests when running in the CI
environments.

See https://github.com/wxWidgets/wxWidgets/pull/2315
2021-04-07 18:35:09 +02:00
Vadim Zeitlin
2e119c5d6e Don't fail tests under AppVeyor CI if socket stream test fails
This happens regularly for unknown reasons (and can't be reproduced
locally), so just ignore the failure if it happens and carry on.
2021-04-07 18:34:08 +02:00
Paul Cornett
4faf7d45de Avoid assert failure in shaped sample
wxBG_STYLE_TRANSPARENT cannot be changed after creation
2021-04-07 09:07:42 -07:00
Stefan Csomor
26bc2c015b remove obsolete macOS SDK guards
we need SDK 10.11 now
2021-04-07 16:37:58 +02:00
Vadim Zeitlin
9437a6abf0 Show assert stack if in the test if possible
Make wxAppTraitsBase::GetAssertStackTrace() and reuse it in the assert
handler defined in the test to show more information about the asserts,
especially those failing in worker threads, if possible.
2021-04-07 14:37:16 +02:00
Vadim Zeitlin
fb136cf154 Merge branch 'gtk-dvc-faster-insert'
Improve performance of wxGTK wxDataViewCtrl when inserting many items.

See https://github.com/wxWidgets/wxWidgets/pull/2313
2021-04-07 12:47:10 +02:00
Vadim Zeitlin
0a0a571ee2 Rename AllowSort() to FreezeSort()
This better reflects the temporary nature of forbidding sort.

Also add a comment describing this better.
2021-04-07 12:46:11 +02:00
Vadim Zeitlin
d173c3f74b Rename the new sort-related methods
Don't use SetAllowSort() in one class and {Allow,Forbid}Sort() in
another one, both could be fine on their own but not together.

Also simplify code by forbidding sorting only if necessary (and add a
comment explaining why do we do it), which removes the need for
re-allowing it from two different places.
2021-04-07 12:46:11 +02:00
Vadim Zeitlin
8c9c16a578 Initialize new m_allow_sort member
Its initial value is otherwise undefined.
2021-04-07 12:46:11 +02:00
sbesombes
0ab446140d Speed up inserting items in sorted wxDataViewCtrl in wxGTK
Avoid resorting the tree on each insertion, this results in horrible
performance even with a few thousand items. Instead, sort all the new
items only once at the end.
2021-04-07 12:44:56 +02:00
Vadim Zeitlin
bc12930061 Merge branch 'filename-resolve-symlink'
Add wxFileName::ResolveLink().

See https://github.com/wxWidgets/wxWidgets/pull/2300
2021-04-07 12:38:37 +02:00
Vadim Zeitlin
b67bd4c3cb Merge branch 'file-history-styles'
Allow finer control over showing or hiding paths in wxFileHistory menus.

See https://github.com/wxWidgets/wxWidgets/pull/2282
2021-04-07 12:37:06 +02:00
Stefan Csomor
605c3a11e6 moving code from factory methods into respective constructors 2021-04-07 09:15:43 +02:00
Stefan Csomor
e796ba880b fixing double conversion
0.5 / scaleFactor is already doing the device to userspace conversion, avoid doing it twice (lead to a 0.125 user space offset on Retina)
2021-04-07 09:10:37 +02:00
Vadim Zeitlin
9353e102dd Catch exceptions from wxEVT_{QUERY_,}END_SESSION handlers too
Similarly to the previous commit, call SafelyProcessEvent() to prevent
the exceptions from escaping into MSW.

See #19133.
2021-04-07 02:12:34 +01:00
Vadim Zeitlin
44a37b5912 Fix handling exceptions from wxEVT_CHAR_HOOK handlers in wxMSW
Catch all the exceptions when processing this event from the keyboard
hook as they must not escape from it and outside of the application.

Closes #19133.
2021-04-07 02:08:48 +01:00
Vadim Zeitlin
1b30e64179 Fix spelling in an assert failure message
No real changes.
2021-04-07 01:45:32 +02:00
Vadim Zeitlin
e551549015 Don't define unused variable in !wxHAS_NATIVE_READLINK case
Also make it const because it can be.

No real changes.
2021-04-07 01:43:56 +02:00
Vadim Zeitlin
1035ae27a7 Make wxSplit(wxJoin()) idempotent for string ending with escape
Previously, splitting a string obtained by joining together array
with (any but last) elements ending in the escape character (normally
the backslash), didn't recover the original array because the separator
character following it in the resulting string was considered to be
escaped by wxSplit().

Fix this by escaping the trailing escape character itself.

Add a test confirming that this works as expected now, document this
behaviour and also slightly simplify wxSPlit() logic.

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

Closes #19131.
2021-04-07 01:38:43 +02:00
Vadim Zeitlin
6810fafa31 Merge branch 'fix-grid-demo'
Fix colour of starts in the grid sample.

See https://github.com/wxWidgets/wxWidgets/pull/2019
2021-04-07 01:37:32 +02:00
Ilya Sinitsyn
8b6d01c798 Fix grid demo stars drawing to use correct colours and font
Just add a call to SetTextColoursAndFont() now that it is present in
this renderer base class (see the parent commit) to ensure that the
correct, i.e. corresponding to the column attribute, colour is used for
the stars.
2021-04-06 22:51:12 +02:00
Vadim Zeitlin
317ad65079 Move SetTextColoursAndFont() to wxGridCellRenderer
Move this function from wxGridCellStringRenderer to its base class to
allow using it even in the classes not drawing any strings.

Also document it.
2021-04-06 22:51:08 +02:00
Vadim Zeitlin
a957d29f8c Mention wxDIR_HIDDEN in GetAllFiles() documentation
It may not be obvious that hidden files are not returned without it.
2021-04-06 22:19:03 +02:00
Tobias Taschner
0ff1bdec09 Add wxFullScreenEvent for macOS
Send a wxFullScreenEvent when the user enters or exits full screen on
macOS. EnableFullScreenView() has to be used to enable the native
full screen API.

Closes https://github.com/wxWidgets/wxWidgets/pull/2284
2021-04-06 19:01:25 +02:00