Commit Graph

72378 Commits

Author SHA1 Message Date
utelle
8ab635b451 Improve wxLocale backwards compatibility and enhance wxUILocale
Restore the old behaviour of wxLocale, which is supposed to use the
default locale and not the preferred language, which may not be the same
(see #22281).

Also apply the following fixes and improvements to wxUILocale:

- Add new GetSystemLocale() method.
- Change the MSW implementation to use the default locale instead of the
  preferred UI language for Windows versions below Windows 10.
- Change the Unix implementation to respect LANGUAGE environment
  variable and use it for determining the preferred UI languages.
- Use wxUILocale in wxTranslations to determine the preferred UI
  languages.
- Use wxUILocale during initialization of internat sample.

Closes #22281.

Closes #22318.
2022-04-17 18:04:21 +02:00
Maarten Bent
4a3098aebb Optimize MSW wxNotebook background painting
MSWDefWindowProc(WM_PAINT, ...) in OnPaint causes performance issues on
large screens so only use it when an actual custom background colour is
set.

Closes #22308.

Closes #22320.
2022-04-17 17:59:24 +02:00
Vadim Zeitlin
7d31e055c4 Don't touch non-wx libraries in "make install" under Mac
Only run install_name_tool on our own libraries as part of "make
install" instead of doing it on all libraries in the installation
directory: this was at best useless and at worst harmful, as some
combinations of install_name_tool and macOS versions don't work well
together and result in corrupting the already installed libraries.
2022-04-17 17:59:01 +02:00
Vadim Zeitlin
73dc9086f5 Don't fail the entire CI run just because of cache saving error
Update ccache-action to a not yet released version including the fix for
failing the entire CI job if saving the cache failed -- this shouldn't
happen at all, but in practice it does happen from time to time, and
it's better to succeed, rather than fail in this case.
2022-04-16 16:07:20 +02:00
kkocdko
02741a6c92 CMake: Fix build with wxBUILD_MONOLITHIC
Add wxUSE_WEBVIEW test before using wx_webview_copy_webview2_loader.

Closes #22315, #22316.
2022-04-16 15:38:44 +02:00
Maarten Bent
4fa3b8c276 CMake: Fix the minimum supported version
Change the minimum version to 3.0. Version 2.8.12 has never worked,
because it does not support the VERSION parameter in project().

Replace GREATER_EQUAL comparisons, these are only supported since 3.7.

Move PCH related code to a separate file, and include it after
options.cmake and init.cmake. Because only then the wxBUILD_PRECOMP
variable is fully initialized.

Closes #22312.
2022-04-16 15:35:49 +02:00
PB
92deb92e29 Use doubled backslashes in examples in wxFileName documentation
Fix syntax of C strings in the examples.

Closes #22311.
2022-04-16 15:34:08 +02:00
Vadim Zeitlin
a47382f95d Revert accidental changes to the samples
This reverts parts of 533958be10 (recreating Xcode project files with
new script, 2022-04-16) that seem to have been committed accidentally
and are now preventing CI builds from passing.
2022-04-16 15:33:05 +02:00
Stefan Csomor
88f5a14d34 Removing outdated AppleScript, updating docs 2022-04-16 14:48:58 +02:00
Stefan Csomor
533958be10 recreating Xcode project files with new script 2022-04-16 14:27:24 +02:00
Artur Wieczorek
d72a3f7cec Create wxBitmap compatible with wxDC for all ports
Ctor creating wxBitmap compatible with wxDC is now implemented in all
ports.
2022-04-15 10:12:41 +02:00
DINAKAR T.D
95cb963d33 Update Tamil translations for wx 3.1.6 2022-04-14 23:57:45 +02:00
Maarten Bent
9a255463f9 Fix wrong wxMenuItem::GetBitmap() return type documentation
This function returns wxBitmap by object, not by (const) reference since
wxBitmapBundle-related changes.

Also change signature of the other methods taking wxBitmapBundle instead
of wxBitmap now.

And some other minor improvements.

Closes #22306.
2022-04-14 23:22:41 +02:00
Vadim Zeitlin
105e81a4b0 Merge branch 'cmake-gtk2' of github.com:MaartenBent/wxWidgets
Fix some CMake and build warnings with GTK2.

See #22305.
2022-04-14 23:19:54 +02:00
Vadim Zeitlin
54bdc6bbd2 Merge branch 'configure-snprintf'
Don't use AC_CHECK_FUNCS(snprintf) which doesn't work with the latest
MinGW API headers (see https://sourceforge.net/p/mingw-w64/bugs/935/)
and some other minor cleanup.

See #22302.
2022-04-14 23:18:16 +02:00
Maarten Bent
5bea1dc18a Fix static build using extended RTTI
Fix declaration of 'o' hides previous local declaration warnings.

Change two wxCONSTRUCTOR_5 definitions using wxBitmapBundle instead of
wxBitmap (this does not give build errors).

wxGenericCalendarCtrl is missing all XTI implementations, so just use
RTTI. And fix building the xti sample.

Note the shared build still fails due to WXDLLIMPEXP related issues.

Closes #22300.

Closes #22301.
2022-04-14 23:17:05 +02:00
Maarten Bent
34afcb57a8 CMake: Improve Linux GTK2 build
Use version comparison instead of normal comparison for libnotify.
Fix warning if mismatched if statement in FindGNOMEVFS2.
Check for GREATER_EQUAL GTK versions, same as configure does.
Don't check for GTK 1 or define __WXGTK127__. CMake does not support GTK1 and it should not be defined when GTK 2/3/4 is used.
2022-04-14 22:59:08 +02:00
Maarten Bent
5ebcfd7681 Fix warnings in GTK2 build 2022-04-14 22:58:46 +02:00
Vadim Zeitlin
0ba4cf8ac9 Avoid spurious MSVC warning about uninitialized variable
Use wxDUMMY_INITIALIZE() to suppress a warning in wxDVC unit test.
2022-04-14 17:46:39 +01:00
Vadim Zeitlin
4e6e1ce054 Show debug log messages on the console in the test when enabled
Using LogEnabler in wxFileSystemWatcher test case still didn't show
anything even in case of unexpected failures because debug messages
didn't appear in the test output.

Fix this by using a custom log target which shows the debug (and trace)
messages on stderr, instead of using the debug output for them, even
under MSW.

Also make LogEnabler public, and rename it to a more unique name, as it
could be useful in the other tests too.
2022-04-14 17:37:32 +01:00
Vadim Zeitlin
4b918d16d0 Fix wrong format specifier in wxMarkupParser debug logs
Use "%z" and not "%l" for size_t arguments.
2022-04-14 17:37:32 +01:00
Vadim Zeitlin
0407d74eaa Remove __WXSTUBS__ mention and test
This has never really been a thing and there remained just one (never
used) test for it in the sources, so simply remove it.

No real changes.
2022-04-14 00:40:36 +02:00
Vadim Zeitlin
7b45060d30 Remove remains of Classic Mac support
Don't test for __WXMAC__ after testing for __UNIX__ just above, as the
latter is now always defined when the latter is, we don't support
non-Unix Mac systems since an awfully long time.

No real changes.
2022-04-14 00:39:37 +02:00
Vadim Zeitlin
d31d645777 Drop remains of support for Metrowerks Standard C++ library
This compiler is not supported since a very long time, so get rid of the
tests for __MSL__.
2022-04-14 00:38:03 +02:00
Vadim Zeitlin
7b0d77e0c0 Remove checks for [v]snprintf() and vsscanf() declarations
Consider that all still supported/existing platforms provide these
declarations, if they provide these functions at all (and they probably
all do, so we almost certainly could remove all the test for them, but
keep them for now).

Note that we still test for broken declarations as this might still be
useful on HP-UX 11 systems, where this problem was reported "only" 8
years ago.

By not using AC_CHECK_FUNCS() we avoid the problem when using it with
snprintf() when cross-compiling with the latest MinGW API headers, see
https://sourceforge.net/p/mingw-w64/bugs/935/ for more details.

This commit is best viewed ignoring whitespace-only changes.
2022-04-14 00:33:51 +02:00
Vadim Zeitlin
d63b0c2cf9 Update libtiff submodule to remove snprintf() check in configure
This fixes build failure when using the latest MinGW headers.
2022-04-14 00:26:01 +02:00
Vadim Zeitlin
ce46d77360 Merge branch 'bitmap-dc-ctor'
Add wxBitmap ctors taking wxDC to all ports and set the scale factor
correctly in the existing ctors taking wxDC in wxMSW.

See #22297.
2022-04-13 15:57:35 +02:00
Vadim Zeitlin
85daadd659 Merge branch 'cmake-improvements' of https://github.com/MaartenBent/wxWidgets
Use newer CMake PCH support instead of cotire and many other
improvements to CMake build system.

See #22295.
2022-04-13 15:56:09 +02:00
Vadim Zeitlin
2d719165ca Fix wxMSW build with wxUSE_UNICODE==0
Use wxChar in wxUILocaleImplLCID to allow the code to compile and work
correctly even when GetLocaleInfo() is GetLocaleInfoA() and not the W
version as usual.

Closes #22299.
2022-04-12 23:46:36 +02:00
Maarten Bent
039f0a924a CMake: Create only one target file
Put the target file in lib/cmake/wxWidgets directory.
2022-04-12 22:08:46 +02:00
Maarten Bent
797df0530d CMake: Fix different identifier warning when building with XCode
Add plist file to the Resource group.
2022-04-12 22:08:46 +02:00
Maarten Bent
681e32f521 CMake: Add IS_MONO option to wx_add_library and wx_set_target_properties
Use this instead of checking for the target name.
2022-04-12 22:08:45 +02:00
Maarten Bent
323e6e8320 CMake: Fix using precompiled headers with Objective-C++ files
Compiling .mm files gives error 'Objective C file was disabled in PCH but is currently enabled'.

Enable the OBJCXX language so the Objective-C++ compiler will be detected and used for .mm files instead of the c++ compiler.
Detect if there are .mm files and enable PCH for them too.

Don't set COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS when cotire is not used.
2022-04-12 22:08:45 +02:00
Maarten Bent
0f8b828394 Fix unused parameter warning in macOS build 2022-04-12 22:08:45 +02:00
Vadim Zeitlin
24970061fa Add wxBitmap(wxImage, wxDC) ctor to all ports
This ctor was previously present only in wxMSW, make it available in all
ports to allow the same code to compile everywhere.

In most of them wxDC argument is simply ignored, but in wxGTK and wxOSX
it is used to assign the appropriate scale factor for the new bitmap.

Enable previously wxMSW-only unit test checking for this.
2022-04-12 19:08:56 +01:00
Vadim Zeitlin
b185186ebf Handle scale factor in another wxMSW wxBitmap ctor taking wxDC
This is similar to db6d565fad (Handle wxDC scale factor in wxBitmap ctor
taking wxDC in wxMSW, 2022-04-10), but for the constructor taking
wxImage and wxDC -- it should also use the DC scale factor, even if it
is not used for scaling the bitmap size in this case.

Add a unit test checking for this.
2022-04-12 17:57:49 +01:00
Vadim Zeitlin
558a300996 Create bitmaps from image and a wxDC without an HDC in wxMSW
This is similar to 7382e99bbb (Create bitmaps even when given a wxDC
without an HDC in wxMSW, 2022-04-10) and does the same change to
wxBitmap ctor from wxImage and wxDC -- and also extends the unit test to
check for this under wxMSW, which is the only port in which this ctor is
currently available.
2022-04-12 17:30:42 +01:00
Maarten Bent
05917b04ae CMake: Add source group for CMake files
Add all of the CMake related files together in one group/filter.
This includes the CMakeLists.txt of the project, cmake_pch.[hxx,cxx] when
using CMake's precompiled header feature, and a .rule file created by cotire.

Also include manifest files in the Resource group. Even though they are not
visible (in VS2022), they would create an empty MSW Headers group for samples.
2022-04-11 23:29:16 +02:00
Maarten Bent
d61c9ee4bf CMake: Apply source groups using a function
This will add source groups to all projects, not only libraries.
And there is no need anymore to include it in every project file.
2022-04-11 23:18:58 +02:00
Maarten Bent
7683219f90 CMake: Remove duplicate and unused defines
Remove unused CMake code to get number of mono source files.
wxUSE_BASE=1 is also defined in wx_set_target_properties.
There seems no reason to define _LIB and DLL_EXPORTS, wx does not use it. They
were probably added because the vcxproj files have them.
2022-04-10 23:44:59 +02:00
Maarten Bent
4999c1c84b CMake: Export WXUSINGDLL for shared builds
Always define WXUSINGDLL for plugins.
2022-04-10 23:41:49 +02:00
Maarten Bent
87465898f3 Fix unused variable warnings 2022-04-10 23:41:44 +02:00
Maarten Bent
13a82b3d67 CMake: Fix building tests and sample after making target includes private 2022-04-10 23:41:44 +02:00
Maarten Bent
f00e7ced27 CMake: Fix monolithic build
Don't target net and webview libraries directly, but use the wx_ function that will add it to the mono library when applicable.
2022-04-10 21:00:39 +02:00
Maarten Bent
0125a52376 CMake: Improve handling plugin in wx_set_target_properties
Don't link with toolkit or wx libraries, and set the correct defines.
2022-04-10 21:00:39 +02:00
Maarten Bent
f4367b3fee CMake: Use target_precompile_headers when available
Keep using cotire for CMake versions older than 3.16, or when user specifies wxBUILD_PRECOMP=COTIRE.
The scintilla headers need to be specified for target_precompile_headers to work.
Enable it when the target has at least 2 source files (same as cotire does).
2022-04-10 20:46:56 +02:00
Maarten Bent
614d58bf38 CMake: Set precompiled headers when adding libraries
Combine the three pch related functions into one.
2022-04-10 20:46:56 +02:00
JackBoosY
e2a02d4206 CMake: Export target files 2022-04-10 20:46:56 +02:00
Maarten Bent
affbbce1a3 CMake: Make all target_compile_definitions private
It is only used to build scintilla, no need to expose these definitions to external projects.
2022-04-10 20:46:53 +02:00
Maarten Bent
de495c19a3 CMake: Make all target_include_directories private
There is no need to expose them to external projects.
2022-04-10 20:46:26 +02:00