Commit Graph

70572 Commits

Author SHA1 Message Date
Vadim Zeitlin
5e53f74af1 Make wxImage ctor from XPM data explicit
This avoids accidental conversions from XPM to wxImage which can result
in the use of an expected wxBitmap ctor later.

See #19149.
2021-04-18 01:14:36 +01:00
Vadim Zeitlin
72500faf7c Add wxCursor ctor from XPM data to all ports
This just uses the existing wxImage ctor from XPM data and wxCursor ctor
from wxImage, but will allow the code creating cursors from XPM to still
work even when wxImage ctor from XPM is made explicit.

Add a trivial test just to check that the new ctor can be used.
2021-04-18 01:14:36 +01:00
Vadim Zeitlin
9c6e67cac0 Rename Mac wxCursor::CreateFromImage() to InitFromImage()
Use the same name as in the other ports for the function doing the same
thing, there doesn't seem to be any good reason to name it differently.

Also avoid declaring it when wxUSE_IMAGE==0 as it's not defined in this
case (again, consistently with the other ports).
2021-04-18 00:59:52 +01:00
Vadim Zeitlin
b26fd44c77 Consistently declare wxCursor(wxImage) ctor when wxUSE_IMAGE==1
wxGTK already did it like this, but also only declared ctor not taking
wxImage in this case, while wxMSW and wxMac declared this ctor in any
case, even when wxUSE_IMAGE==0, but didn't define it then.

This doesn't matter much anyhow, as the build with wxUSE_IMAGE==0 is
clearly broken and these changes are not enough to fix it, but be at
least somewhat consistent and:

1. Don't declare methods using a class which is not available at all.
2. Do define methods using wxImage only internally, even if they do
   nothing when it's not available.

No real changes.
2021-04-18 00:59:52 +01:00
Artur Wieczorek
b889f6897b Fix determining height of monochrome HICON in wxGetHiconSize()
For monochrome icons height reported by GetObject() is doubled because
icon bitmap contains both AND and XOR masks. To get actual icon height
we need to divide the value by 2.

Closes #19146.
2021-04-17 00:04:28 +02:00
Vadim Zeitlin
9ef30e728a Merge branch 'ci-cleanup'
Minor cleanup for the CI setup script.

See https://github.com/wxWidgets/wxWidgets/pull/2329
2021-04-16 23:32:21 +02:00
Vadim Zeitlin
16e0be9f26 Merge branch 'msw-thread-tls-fix-and-cleanup'
Minor cleanup in wxMSW wxThread code.

See https://github.com/wxWidgets/wxWidgets/pull/2327
2021-04-16 22:30:38 +01:00
Vadim Zeitlin
e3691dbc13 Explain reason for invalidating gs_tlsThisThread better
Just improve a comment, no real changes.
2021-04-16 22:30:09 +01:00
Vadim Zeitlin
f3b275321c Update comment to mention GitHub CI too
No real changes.
2021-04-16 19:23:28 +02:00
Vadim Zeitlin
994400eb17 Don't dump apt preferences in the CI build logs
This doesn't seem very useful and results in a lot of output.
2021-04-16 19:13:00 +02:00
Vadim Zeitlin
15aaf9a163 Stop installing debug repository apt key manually
This shouldn't be necessary any longer, as the corresponding Ubuntu bug
(https://bugs.launchpad.net/bugs/1920640) is supposed to be fixed.
2021-04-16 19:10:16 +02:00
PB
1c15e05260 Mention example CMake file in CMake Overview 2021-04-16 12:35:12 +02:00
Vadim Zeitlin
c1cc71066f Remove gs_critsectThreadDelete which was never used
This variable was added back in 3ef22a5b02 (trying to fix race
conditions. double deletions and memory leaks on thread termination...,
2003-09-21), but not used even then, nor ever since, so just remove it.
2021-04-15 19:03:51 +01:00
Kenneth Porter
f7f874f77a Invalidate TLS slot index when shutting down the library
Not doing it could result in using the now invalid or, worse, reassigned
to some other DLL, TLS slot if the library is initialized again later.

Also add asserts checking that the index is initialized before using it.
2021-04-15 18:59:47 +01:00
Vadim Zeitlin
5b0b50f164 Use symbolic TLS_OUT_OF_INDEXES constant instead of literal one
This constant has the same value but is more readable.

No real changes.
2021-04-15 18:59:13 +01:00
Václav Slavík
db3e54b3dc macOS: Don't interfere with native views' drag and drop
wxWidgetCocoaImpl injects implementation of several
NSDraggingDestination protocol methods, but never called their base
implementations, presumably on the assumption that drag and drop is
explicitly supported and not builtin into native NSView-derived
controls.

This prevented native builtin d'n'd in e.g. NSTextView (text can be
copied and inserted by dragging it to the insertion point) from
working. Fixed by always calling base implementation.

Closes https://github.com/wxWidgets/wxWidgets/pull/2320
2021-04-14 17:59:28 +02:00
Vadim Zeitlin
dc5f1711f2 Upgrade version to 3.1.6
Run misc/scripts/inc_release, bakefile_gen and autoconf.
2021-04-14 17:57:27 +02:00
Vadim Zeitlin
bbd4eca470 Use nicer labels for wxWidgets property sheets in MSVS UI
No real changes, just use the same _PropertySheetDisplayName element as
the standard style sheets use to show a slightly more user-friendly
label in the Property Sheet manager window in MSVS.
2021-04-14 15:44:09 +01:00
Vadim Zeitlin
6fb2b9b676 Add 3.1.6 change log section 2021-04-14 16:28:27 +02:00
Vadim Zeitlin
0bbc074095 Update binaries SHA-1 sums for 3.1.5 release too 2021-04-14 16:25:27 +02:00
Vadim Zeitlin
51fb9e4720 Update SHA-1 sums for 3.1.5 release files
This is simply the result of running ./build/tools/post-release.sh
2021-04-13 00:47:05 +02:00
Vadim Zeitlin
9c0a8be1dc Merge branch 'gtk-initial-size'
Fix initial size of TLWs in wxGTK when using both sizers and explicit
SetSize() calls.

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

See #16088, #19134.
2021-04-13 00:23:58 +02:00
Vadim Zeitlin
2e16418707 Update TLW client size in wxGTK before sending wxEVT_SHOW
If we have to change the client size, it's better to do this before
sending the event whose handler might rely on the size being already
correct.

Co-Authored-By: Paul Cornett <paulcor@users.noreply.github.com>
2021-04-12 21:27:32 +02:00
Vadim Zeitlin
b5a78fbac6 Also make SetMinSize() after wxSizer::Fit() work correctly
This fixes a problem similar to that fixed in the previous commit but
for SetMinSize(), which was also ignored if done after calling
wxSizer::Fit() and before showing the window, as the explicitly set min
size was also overwritten by the pending min size computed from the
client size corresponding to the sizer fitting size.

The fix is similar too: just invalidate the pending minimum size if
SetMinSize() is called.
2021-04-12 21:19:25 +02:00
Vadim Zeitlin
645e1d2fd0 Don't overwrite explicitly set size with pending client size
Calls to SetSize() were ignored in wxGTK if they happened after calling
wxSizer::Fit() since the changes of f655a52fba (Allow wxSizer::Fit() to
work properly when called from TLW ctor on GTK3, 2020-04-20) because we
overwrote the explicitly set size with the client size computed earlier
by the sizer.

Don't do this by explicitly forgetting the client size we were going to
set when SetSize() is called.

Closes #19134.
2021-04-12 21:19:25 +02:00
Vadim Zeitlin
fd7386ed83 Move workaround for initial TLW size to wxGTK itself
Add wxWindow::WXSetInitialFittingClientSize() instead of handling wxGTK
TLWs specially in the common wxSizer code and override it in wxGTK to
remember that we need to reset the client size once the window is shown.

This commit shouldn't result in any changes in the observed behaviour.
2021-04-12 21:19:25 +02:00
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