Commit Graph

70591 Commits

Author SHA1 Message Date
Vadim Zeitlin
32258bd10a Move wxEVT_TEXT generation to wxSpinCtrlGTKBase::GTKTextChanged()
This is more consistent with GTKValueChanged() and allows making the
change in the upcoming commit.

No real changes yet, this is just a refactoring.
2021-04-21 09:02:51 +02:00
Vadim Zeitlin
e7c9bd32fd Fix return type of GtkSpinButton "output" signal handler
This doesn't seem to change anything in practice, but still use the
correct return type.

Co-Authored-By: Paul Cornett <paulcor@users.noreply.github.com>
2021-04-21 08:32:37 +02:00
Vadim Zeitlin
496aefbf88 Document wxSpinCtrl::SetValue("") behaviour
Mention that this is explicitly allowed now that it works.

Co-Authored-By: Dummy <dummy@trac.wxwidgets.org>
2021-04-20 22:23:14 +02:00
Vadim Zeitlin
ca0cf3ea59 Allow using a different text value in wxGTK wxSpinCtrl
Make it possible to use a string value different from the numeric value,
as wxMSW version allows this and some existing code depends on it.

Closes #19140.
2021-04-20 22:23:14 +02:00
Vadim Zeitlin
e73a0c23ef Replace dynamic cast with a virtual GTKValueChanged() function
No real changes, but using a virtual function is simpler and safer than
using wxIsKindOf().
2021-04-20 01:13:15 +02:00
Vadim Zeitlin
3ac3763705 Always handle "input" and "output" signals in wxGTK wxSpinCtrl
No real changes yet, just refactor the code to always connect these
signals handlers and not just when using non-decimal base.

Add wxSpinCtrl::GTKInput() and GTKOutput() virtual methods to handle
these signals appropriately depending on the type of the control.

This will allow further customizing conversion to/from string in the
upcoming commit and will also make it possible to handle UI locale
different from the C locale in the future.
2021-04-20 01:13:15 +02:00
Vadim Zeitlin
8194f05553 Simplify event sending code by using GetTextValue()
Just use this function now that it's available rather than calling
gtk_entry_get_text() (and sometimes forgetting to specify UTF-8 encoding
explicitly).
2021-04-20 01:13:15 +02:00
Vadim Zeitlin
4b263ff10a Explicitly convert from UTF-8 in wxSpinCtrl::GetTextValue()
Use UTF-8 encoding explicitly rather than relying on it being the
default.
2021-04-20 01:06:24 +02:00
Dummy
f64da1eb36 Allow clearing spin controls in the widgets sample
Calling wxSpinCtrl::SetValue("") is always valid.

See #19140.
2021-04-20 00:59:22 +02:00
Vadim Zeitlin
34ab87ce4d Get rid of CppUnit boilerplate in wxSpinCtrlDouble unit test
This was already done for wxSpinCtrl unit tests in a4928c0fde (Use Catch
in wxSpinCtrl unit tests, 2020-07-12), do it for wxSpinCtrlDouble too
now.
2021-04-20 00:59:22 +02:00
Vadim Zeitlin
11967af49f Make wxSpinCtrl::GetTextValue() pure virtual
It is now implemented in all ports.
2021-04-18 13:09:51 +02:00
Vadim Zeitlin
e5042a6a53 Implement wxSpinCtrl::GetTextValue() for wxQt too 2021-04-18 13:09:43 +02:00
Vadim Zeitlin
f2d3589d88 Also implement wxSpinCtrl::GetTextValue() for wxGTK1 2021-04-18 13:09:43 +02:00
Dummy
b6f8a8cf5b Add wxSpinCtrl::GetTextValue()
This allows to retrieve the current contents of the text entry part of
wxSpinCtrl.

For now provide a stub in the base class, will be made pure virtual
later.

Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>
2021-04-18 13:09:17 +02:00
Vadim Zeitlin
c6d6ec9295 Merge branch 'msw-fix-decimal-point' of https://github.com/vslavik/wxWidgets
Fix decimal point assertions with unknown Win32 locales.

See https://github.com/wxWidgets/wxWidgets/pull/2330
2021-04-18 02:10:51 +02:00
Vadim Zeitlin
2103fd2e17 Merge branch 'xrc-paths'
Allow loading XRC from wxXmlDocument and use it to add a test for
bitmap paths URI encoding in XRC.

See https://github.com/wxWidgets/wxWidgets/pull/2325
2021-04-18 02:08:16 +02:00
Václav Slavík
b466e3c769 Restore Win32 locale in wxLocale destructor 2021-04-17 15:12:45 +02:00
Václav Slavík
c9e2143a7a Fix wxLocale::GetInfo() for unknown Windows locales
wxWidgets may be unaware of the locale being used and may be unable to
get correct information from its languages database. For example, en-AT
locale, supported by Windows 10 and using "," for decimal point, would
be interpreted as en-US by wx, and return "." here.

The other situation, when wx supports a locale that the OS doesn't,
shouldn't make a difference here because in that case, CRT wouldn't
support the locale either and CRT formatting functions wouldn't be set
to use it.

See also somewhat related 9fc78c8167.
2021-04-17 15:12:45 +02: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
2babb9e06c Document and test that bitmap paths in XRC are percent-encoded
These paths are actually URLs and so the special URL characters must be
percent-encoded in them.

Document this and add a test checking that this is how it works.

Closes #19142.
2021-04-15 19:20:32 +01:00
Vadim Zeitlin
b9bd932077 Micro optimize string concatenation in wxFileSystem::OpenFile()
Concatenate the string only once instead of doing it several times.
Compiler might be optimizing this anyhow in release builds, but it
definitely helps in at least the debug ones and doesn't cost anything.
2021-04-15 19:20:32 +01:00
Vadim Zeitlin
97750eb282 Don't try relative paths in wxFileSystem if current path is empty
This seems redundant, as the loop is the same as the one just below it
which is executed in any case if this one doesn't find anything.
2021-04-15 19:20:32 +01:00
Vadim Zeitlin
ebedd023f5 Use wxXmlResource::LoadDocument() in XRC unit tests
This is simpler and better than creating a temporary file unnecessarily
and also serves as a test of the just added function.
2021-04-15 19:20:32 +01: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
Vadim Zeitlin
c16082edfe Add wxXmlResource::LoadDocument()
This allows loading XRC from anywhere, not just files and URLs.
2021-04-15 18:50:47 +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