Commit Graph

70753 Commits

Author SHA1 Message Date
Vadim Zeitlin
bf5235e01c Merge branch 'explicit-image-from-xpm'
Make wxImage ctor from XPM data explicit to avoid surprising behaviour.

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

Closes #19149.
2021-04-20 00:21:16 +01: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
Václav Slavík
9a3bbde2d1 Generalize wxBookCtrlBase::m_bookctrl to wxWindow
The field is used for common placement and sizing logic in
notebook-like controls that have a "controller buddy" control. Its use
isn't wxControl-specific and only relies on wxWindow API, so the
restriction to wxControl-inherited types is arbitrary.

Change the type to the more general wxWindow* pointer.

In practical terms, this allows derived classes to use e.g.
wxNativeWindow as the controller buddy.
2021-04-19 13:54:17 +02:00
Vadim Zeitlin
1dfc18a004 Link with ws2_32.lib rather than obsolete wsock32.lib
Winsock 2 provided by ws2_32.lib is available since 1994, it should be
fine to use it even for wx in 2021.

See #15562.
2021-04-18 22:13:45 +02:00
Vadim Zeitlin
68a8d6a11c Remove obsolete and unnecessary wsock32.dll dynamic loading code
This is unnecessary at least since removal of Windows CE support back in
8282c1be0f (Remove Windows CE support, 2015-08-27) and probably for much
longer.
2021-04-18 21:12:09 +01:00
Vadim Zeitlin
74b2a33c69 Remove obsolete libraries from .gitignore
Remove some Watcom and, apparently, Symantec-specific files as both
compilers are not used any more since many, many years.
2021-04-18 21:03:02 +01:00
Stefan Csomor
cb8d7c533f
Update MacS-M1-make.yml
try simple steps
2021-04-18 21:14:19 +02:00
Stefan Csomor
260283fc5c
Update MacS-M1-make.yml
try local install to avoid sudo
2021-04-18 20:45:12 +02:00
Stefan Csomor
64446f0955
Update MacS-M1-make.yml
build both
2021-04-18 20:24:05 +02:00
Stefan Csomor
866254dda0
Update MacS-M1-make.yml
add parallel build, try running tests, skip install
2021-04-18 19:56:17 +02:00
Stefan Csomor
2e4cf11d15
launch again 2021-04-18 19:40:02 +02:00
Stefan Csomor
9c509b966c
Create MacS-M1-make.yml
First Action for M1 Mac
2021-04-18 19:34: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
Václav Slavík
15b0648041 Fix wxReadlink signature to return ssize_t
Introduced in 53bd139, wxReadlink() trivially wraps readlink(), but
returned int instead of ssize_t as defined for readlink() by POSIX.

Fixes "Implicit conversion loses integer precision: 'ssize_t' (aka
'long') to 'int'" on platforms with sizeof(ssize_t)>sizeof(int).
2021-04-18 11:00:41 +02:00
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
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
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
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