Commit Graph
100 Commits
Author SHA1 Message Date
Lauri Nurmi 90880faafc Output Windows 'feature update' version in wxGetOsDescription()
This means version labels such as 25H2, 24H2.
2026-06-01 18:16:50 +03:00
Lauri Nurmi 8f4b215241 Output Windows type (Home/Pro/Enterprise) in wxGetOsDescription() 2026-06-01 18:16:41 +03:00
Lauri NurmiandVadim Zeitlin 78b6140d44 Recommend adding wxWidgets.natvis to one's project
The primary documented way of using a .natvis, in the Microsoft
documentation linked to, is to add it to one's project, not to copy
it under %USERPROFILE%.

Closes #26452.
2026-05-15 02:05:46 +02:00
Lauri NurmiandVadim Zeitlin 7c3e00ccbd Make Linux distribution wxGetOsDescription()'s main output
Unix builds / Ubuntu 18.04 wxGTK 3 compatible 3.0 (push) Has been cancelled
Unix builds / Ubuntu 24.04 wxGTK ASAN not compatible (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK UTF-8 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxQt (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxX11 (push) Has been cancelled
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Has been cancelled
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxDFB (push) Has been cancelled
Unix builds / Ubuntu 24.04 wxGTK UBSAN (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 3 static with gcc 4.8 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 2 (push) Has been cancelled
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Has been cancelled
CMake builds / macOS latest wxGTK 3 Unix Makefiles (push) Has been cancelled
CMake builds / MSW/MSVC wxMSW (push) Has been cancelled
CMake builds / MSW/Clang wxMSW (push) Has been cancelled
CMake builds / macOS latest wxOSX Ninja (push) Has been cancelled
CMake builds / macOS 14 wxOSX Xcode (push) Has been cancelled
CMake builds / macOS 14 wxIOS (push) Has been cancelled
CMake builds / MSW/MSVC wxQt 5.15 (push) Has been cancelled
CMake builds / MSW/MSVC wxQt 6.10 (push) Has been cancelled
Mac builds / wxMac ARM ASAN not compatible (push) Has been cancelled
Mac builds / wxMac Universal C++14 (push) Has been cancelled
Mac builds / wxiOS Simulator on Silicon Mac (push) Has been cancelled
Mac builds / wxiOS (push) Has been cancelled
Mac builds / wxMac Intel C++17 (push) Has been cancelled
Mac Xcode builds / iOS Simulator static (push) Has been cancelled
Mac Xcode builds / macOS dynamic Release (push) Has been cancelled
Mac Xcode builds / iOS static Debug (push) Has been cancelled
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Has been cancelled
MSW builds / wxMSW vs2022 DLL Release x64 (push) Has been cancelled
MSW builds / wxMSW vs2022 Debug Win32 (push) Has been cancelled
MSW builds / wxMSW vs2022 Release arm64 (push) Has been cancelled
MSW builds / wxMSW vs2026 DLL Release x64 (push) Has been cancelled
MSW cross-builds / wxMSW 64 bits not compatible (push) Has been cancelled
MSW cross-builds / wxMSW/Univ (push) Has been cancelled
MSW cross-builds / wxMSW 32 bits (push) Has been cancelled
Code Checks / Check Spelling (push) Has been cancelled
Code Checks / Check Whitespace (push) Has been cancelled
Code Checks / Check Mixed EOL (push) Has been cancelled
Code Checks / Check C++ Style (push) Has been cancelled
Code Checks / Check All Headers In allheaders.h (push) Has been cancelled
Update Documentation / Update Online Documentation (push) Has been cancelled
No Response / no-response (push) Has been cancelled
When available, acquire the name and release of the Linux
distribution and return it as wxGetOsDescription()'s output,
followed by the near equivalent of the traditional 'uname -srm' output.

The uname output, something like "Linux 6.19.0-5-generic x86_64",
is not the best description for a Linux system, since it leaves
up to the reader to figure out what kind of a system this actually
is.

The output changes significantly from what it was earlier, but
the output was never meant to be machine-readable, nor was it
consistent across different operating systems.

Closes #26231.
2026-03-13 16:00:09 +01:00
Lauri NurmiandVadim Zeitlin d7fd467f18 Add wxTextEntryDialog::SetHint()
Sets the hint text for the underlying wxTextCtrl.

Closes #26176.
2026-02-11 13:46:22 +01:00
Lauri NurmiandVadim Zeitlin 7945150061 Remove implementation details from wxGetLinuxDistribution() docs
An introduction to lsb_release is unnecessary, and saying it is very
common on modern Linux distributions is an exaggeration, at least today.

And besides those, the details are not even accurate since
aef7df6 (Read Linux distribution info from os-release file, 2023-07-14)
(#23712), which made lsb_release the fallback method for obtaining
information.

Closes #26125.
2026-01-28 13:27:39 +01:00
Lauri NurmiandVadim Zeitlin b261545160 Do not log bogus system error in wxRenameFile()
There is no failed system call at this point, so there is no relevant
system error available either.

Closes #25985.
2025-11-26 01:16:07 +01:00
Lauri NurmiandVadim Zeitlin dac1996ebe Remove commented out wxGetCurrentDir() that was never used
Unix builds / Ubuntu 18.04 wxGTK 3 compatible 3.0 (push) Has been cancelled
Unix builds / Ubuntu 24.04 wxGTK ASAN not compatible (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK UTF-8 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxQt (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxX11 (push) Has been cancelled
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Has been cancelled
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Has been cancelled
Unix builds / Ubuntu 24.04 wxGTK UBSAN (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxDFB (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 3 static with gcc 4.8 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 2 (push) Has been cancelled
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Has been cancelled
CMake builds / MSW/MSVC wxMSW (push) Has been cancelled
CMake builds / MSW/Clang wxMSW (push) Has been cancelled
CMake builds / macOS latest wxOSX Ninja (push) Has been cancelled
CMake builds / macOS 14 wxOSX Xcode (push) Has been cancelled
CMake builds / macOS 14 wxIOS (push) Has been cancelled
CMake builds / MSW/MSVC wxQt 5.15 (push) Has been cancelled
CMake builds / MSW/MSVC wxQt 6.10 (push) Has been cancelled
Mac builds / wxMac ARM ASAN not compatible (push) Has been cancelled
Mac builds / wxMac Universal C++14 (push) Has been cancelled
Mac builds / wxiOS Simulator on Silicon Mac (push) Has been cancelled
Mac builds / wxiOS (push) Has been cancelled
Mac builds / wxMac Intel C++17 (push) Has been cancelled
Mac Xcode builds / iOS Simulator static (push) Has been cancelled
Mac Xcode builds / macOS dynamic Release (push) Has been cancelled
Mac Xcode builds / iOS static Debug (push) Has been cancelled
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Has been cancelled
MSW builds / wxMSW vs2022 DLL Release x64 (push) Has been cancelled
MSW builds / wxMSW vs2022 Debug Win32 (push) Has been cancelled
MSW builds / wxMSW vs2022 Release arm64 (push) Has been cancelled
MSW cross-builds / wxMSW 64 bits not compatible (push) Has been cancelled
MSW cross-builds / wxMSW/Univ (push) Has been cancelled
MSW cross-builds / wxMSW 32 bits (push) Has been cancelled
Code Checks / Check Spelling (push) Has been cancelled
Code Checks / Check Whitespace (push) Has been cancelled
Code Checks / Check Mixed EOL (push) Has been cancelled
Code Checks / Check C++ Style (push) Has been cancelled
Code Checks / Check All Headers In allheaders.h (push) Has been cancelled
No Response / no-response (push) Has been cancelled
This implementation was surrounded by #if 0 ever since it was added in
7c07201 (don't disable hidden windows in wxWindowDisabler, it's at best
useless, 2003-06-21).

Closes #25982.
2025-11-21 17:40:32 +01:00
Lauri Nurmi 62f7e66795 Assert that DoGetHolidaysInRange and DoIsHoliday agree on holidays
Implementations of the two can be completely independent, yet it
would be surprising if they do not consider the same days to be
holidays.
2025-09-10 00:47:44 +03:00
Lauri Nurmi 907b3fecec Move range check to the public GetHolidaysInRange()
Only wxDateTimeWorkDays::DoGetHolidaysInRange() did an early
exit when start > end, but surely no other overridden
DoGetHolidaysInRange() would want an invalid range either.
2025-09-09 13:14:42 +03:00
Lauri Nurmi 83d7799dd8 Move holiday implementations away from the header
This enables fixing potential bugs in holiday calculations, as
well as adding new holidays, through updating dynamic libraries,
without recompiling the application using wxWidgets.
2025-09-09 13:14:42 +03:00
Lauri Nurmi 68b27a4c54 Do not duplicate DoGetHolidaysInRange() in the derived class
wxDateTimeChristianHolidays had exactly the same implementation
as its parent class.
2025-09-09 13:09:30 +03:00
Lauri NurmiandVadim Zeitlin 9bbb2dfb6b Test only one wxDateTimeHolidayAuthority at a time
wxDateTimeChristianHolidays was tested with a wxDateTimeUSCatholicFeasts
already existing and taking precedence. I.e. the tests for Christmas in
ChristianHolidays actually tested (again) the USCatholicFeasts
implementation.

This reveals an off-by-one bug in wxDateTimeChristianHolidays::DoIsHoliday(),
which doesn't use the enum symbol for month, and declares Christmas to be
on the 25th day of the 13th month.

Further, this raises the question whether it is a bad idea to have the
authority implementations in a header. Fixing bugs like this would
require recompiling the application, instead of simply updating the
DLL/dylib.
2025-08-30 15:05:40 +02:00
Lauri NurmiandVadim Zeitlin ab967cac5b Remove meaningless continue statements 2025-08-30 15:05:40 +02:00
Lauri NurmiandVadim Zeitlin 807aeb252a Move Christmas to December from the 13th month 2025-08-30 15:05:40 +02:00
Lauri NurmiandVadim Zeitlin de68f5bee0 Add missing 'override' to wxCursorBundle code
Fix compilation with -Werror=suggest-override.

Closes #25432.
2025-05-20 15:59:01 +02:00
Lauri NurmiandVadim Zeitlin 6d8b1d4c14 Enable TestTimeTicks() for dates between 1970 and Y2K38
TestTimeTicks() checks were skipped for test dates with gmticks == -1,
ensure that these tests really run by providing the expected ticks
values.

See #24442.
2025-05-10 18:34:01 +02:00
Lauri NurmiandVadim Zeitlin 5438f42b4a Add wxNODISCARD to all Clone*() functions that return a pointer
Calling a Clone*() function without using its return value is in most
(even all) cases a certain way to leak memory.

Closes #25354.
2025-04-30 19:40:45 +02:00
Lauri NurmiandVadim Zeitlin 5ac9465d72 Log last error after unsuccessful LoadIcon/LoadImage calls
Closes #25351.
2025-04-29 19:27:08 +02:00
Lauri NurmiandVadim Zeitlin 80414bef95 Remove obsolete assert about menuitem ID zero on Mac
The assert, introduced in 408aef5 (as we cannot handle zero commands
properly, we have to warn, 2005-01-04) says that menuitem ID zero
does not work on Mac, yet empirically it seems to work just fine.

If it really doesn't work, then this assert should be present in
all other ports too, to help writing portable code.

Closes #25306.
2025-04-11 16:39:21 +02:00
Lauri Nurmi f42bd88931 Compare return value of GetWheelAxis() to enum values, not 0 2025-04-07 11:15:24 +03:00
Lauri NurmiandVadim Zeitlin 96c72db0d7 Move wxGetLibraryVersionInfo() to core from base
Unix builds / Ubuntu 24.04 wxGTK with ASAN (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 3 compatible 3.0 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK UTF-8 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxQt (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxX11 (push) Has been cancelled
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Has been cancelled
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Has been cancelled
Unix builds / Ubuntu 24.04 wxGTK with UBSAN (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxDFB (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 3 static with gcc 4.8 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 2 (push) Has been cancelled
CMake builds / Windows MSVC (push) Has been cancelled
CMake builds / macOS 14 wxIOS (push) Has been cancelled
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Has been cancelled
CMake builds / macOS 14 wxOSX (push) Has been cancelled
Mac builds / wxMac Universal C++14 (push) Has been cancelled
Mac builds / wxMac ARM with ASAN (push) Has been cancelled
Mac builds / wxiOS (push) Has been cancelled
Mac builds / wxMac macOS 14 (push) Has been cancelled
Mac builds / wxMac Intel C++17 (push) Has been cancelled
Mac Xcode builds / iOS static Debug (push) Has been cancelled
Mac Xcode builds / iOS Simulator static (push) Has been cancelled
Mac Xcode builds / macOS dynamic Release (push) Has been cancelled
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Has been cancelled
MSW builds / wxMSW vs2019 DLL Release x64 (push) Has been cancelled
MSW builds / wxMSW vs2019 Debug Win32 (push) Has been cancelled
MSW builds / wxMSW vs2022 Release arm64 (push) Has been cancelled
MSW builds / msw-msys2-clang (push) Has been cancelled
MSW cross-builds / wxMSW 64 bits (push) Has been cancelled
MSW cross-builds / wxMSW/Univ (push) Has been cancelled
MSW cross-builds / wxMSW 32 bits (push) Has been cancelled
Code Checks / Check Spelling (push) Has been cancelled
Code Checks / Check Whitespace (push) Has been cancelled
Code Checks / Check Mixed EOL (push) Has been cancelled
Code Checks / Check C++ Style (push) Has been cancelled
Code Checks / Check All Headers In allheaders.h (push) Has been cancelled
Update Documentation / Update Online Documentation (push) Has been cancelled
Move determining compile-time GTK+/QT versions to wxAppTraits,
which is presumably the only reason why wxGetLibraryVersionInfo()
needed to be in core.

Revert "Move wxGetLibraryVersionInfo() to core from base."
This reverts commit 9aea251043.

Closes #25236.
2025-03-12 23:59:39 +01:00
Lauri Nurmi f222eda6aa Do not #include "wx/list.h" for no reason in various headers 2025-02-28 11:15:01 +02:00
Lauri Nurmi 2034ac4d87 Remove unused C #includes in headers
Don't include standard C headers that aren't used for anything by the
wx headers.
2025-02-28 11:15:00 +02:00
Lauri NurmiandVadim Zeitlin b8d53a263a Fix wxQt compilation after raw touch event changes
Add missing #include "wx/geometry.h".

Broken by 734face (Add support for raw touch events, 2025-01-08).

See #24610.

Closes #25176.
2025-02-17 16:04:04 +01:00
Lauri NurmiandVadim Zeitlin 3fae7f25e4 Include toolkit micro version in wxGetLibraryVersionInfo() too
Instead of outputting just "10.0", output e.g. "10.0.19045".

On Windows, at least, today the micro version has more significance than
it perhaps did 17 years ago when the code was added.

Closes #25175.
2025-02-17 16:00:49 +01:00
Lauri Nurmi 580df3d670 Implement subitem for wxGenericListCtrl::HitTest() 2025-02-10 13:17:46 +02:00
Lauri Nurmi 1ada0f511a Show subitem (column) number in listctrl sample context menu 2025-02-10 13:17:17 +02:00
Lauri NurmiandVadim Zeitlin f88a0a933d Add a script and CI action for tests/allheaders.h
Check that all headers are either #included or mentioned
in tests/allheaders.h.
2025-01-31 17:32:00 +01:00
Lauri NurmiandVadim Zeitlin 01ecc95cea #include all headers in tests/allheaders.h
Despite its description, tests/allheaders.h did not #include all current
headers.

<wx/webview_chromium_impl.h> is left out as excluded.
2025-01-31 17:32:00 +01:00
Lauri NurmiandVadim Zeitlin 5d8ea50d96 Also accept wide string literals as translation macro arguments
Not accepting them was an accidental regression introduced in #24957,
fix it by accepting any kind of characters in the wrapper functions and
not just "char[]".

This went unnoticed because there weren't any such calls in wx's own
tests or samples, so add some to the test suite to prevent similar
regressions in the future.

Closes #25063.
2025-01-13 22:12:42 +01:00
Lauri NurmiandVadim Zeitlin 6561ca0200 Fix warnings when using event table macros with Clang 19.1.6
Unix builds / Ubuntu 22.04 wxGTK with ASAN (push) Has been cancelled
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 3 compatible 3.0 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK UTF-8 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxQt (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxX11 (push) Has been cancelled
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Has been cancelled
Unix builds / Ubuntu 22.04 wxGTK with UBSAN (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxDFB (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 3 static with gcc 4.8 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 2 (push) Has been cancelled
CMake builds / Windows MSVC (push) Has been cancelled
CMake builds / macOS 14 wxIOS (push) Has been cancelled
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Has been cancelled
CMake builds / macOS 14 wxOSX (push) Has been cancelled
Mac builds / wxMac Universal C++14 (push) Has been cancelled
Mac builds / wxMac ARM with ASAN (push) Has been cancelled
Mac builds / wxiOS (push) Has been cancelled
Mac builds / wxMac macOS 14 (push) Has been cancelled
Mac builds / wxMac Intel C++17 (push) Has been cancelled
Mac Xcode builds / iOS static Debug (push) Has been cancelled
Mac Xcode builds / iOS Simulator static (push) Has been cancelled
Mac Xcode builds / macOS dynamic Release (push) Has been cancelled
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Has been cancelled
MSW builds / wxMSW vs2019 DLL Release x64 (push) Has been cancelled
MSW builds / wxMSW vs2019 Debug Win32 (push) Has been cancelled
MSW builds / wxMSW vs2022 Release arm64 (push) Has been cancelled
MSW builds / msw-msys2-clang (push) Has been cancelled
MSW cross-builds / wxMSW 64 bits (push) Has been cancelled
MSW cross-builds / wxMSW/Univ (push) Has been cancelled
MSW cross-builds / wxMSW 32 bits (push) Has been cancelled
Code Checks / Check Spelling (push) Has been cancelled
Code Checks / Check Whitespace (push) Has been cancelled
Code Checks / Check Mixed EOL (push) Has been cancelled
Code Checks / Check C++ Style (push) Has been cancelled
Update Documentation / Update Online Documentation (push) Has been cancelled
Avoid warnings about incompatible casts:

In file included from ../../tests/allheaders.cpp:369:
In file included from ../../tests/testprec.h:5:
In file included from ../../include/wx/evtloop.h:13:
../../include/wx/event.h:141:12: error: cast from 'void (wxEvtHandler::*)(wxFocusEvent &)' to 'wxEventFunction' (aka 'void (wxEvtHandler::*)(wxEvent &)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch]
  141 |     return reinterpret_cast<wxEventFunction>(func);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This warning was already suppressed on GCC; just do the same thing for
Clang also.

Closes #25064.
2025-01-12 15:48:31 +01:00
Lauri NurmiandVadim Zeitlin 3dddaeb8f2 Optional only accept string literals in translation macros
If a new wxNO_REQUIRE_LITERAL_MSGIDS is defined, redirect the
translation macros to wrapper functions that only accept string
literals. This is not enabled by default, because it would be a
backward-incompatible change (even though most incompatibilities
uncovered by it are likely to be bugs), but defining the new macro is
recommended because the arguments nearly always need to be string
literals.

While at present the arguments do not technically need to be string
literals, variables can easily introduce subtle bugs that are not
obvious to spot. The fact that xgettext only picks string literals
is easy to forget.

Consider  the following code:
wxString itm("item");
_(itm);
wxGETTEXT_IN_CONTEXT("context_1", itm);
wxGETTEXT_IN_CONTEXT(itm, "item");
wxPLURAL(wxString::Format("%s", "singX"), "plurX", 1);
wxPLURAL("singY", wxString::Format("%s", "plurY"), 2);
wxGETTEXT_IN_CONTEXT_PLURAL("context_1", _("singZ"), "plurZ", 1);

All of these lines compile without warnings. However, only one string,
"singZ", is picked by xgettext, all others are silently ignored. Some
lines would work if accompanied by a proper wxTRANSLATE* call, but nested
calls (see the last line) to translation macros do not make sense in the
first place.

Closes #24957.
2025-01-08 02:54:01 +01:00
Lauri NurmiandVadim Zeitlin 87c1aae252 Fix double negatives used with 'neither'
Replace most 'neither' words introduced after 2b0ee48ef7
(Fix double negatives used with 'neither', 2023-11-25)
with 'either'.

All changes are to comments only.

Closes #24999.
2024-12-11 17:57:46 +01:00
c9a2d50b6f Mention Poedit
Co-authored-by: PB <12495521+PBfordev@users.noreply.github.com>
2024-11-15 15:10:32 +02:00
Lauri Nurmi 875a725b6d Clarify how the translated error message from wxFile is put together 2024-11-13 12:20:33 +02:00
Lauri Nurmi 42556be9d3 Remove misleading example about wxTRANSLATE()
Placing wxTRANSLATE() within wxGetTranslation() was never its intended purpose,
and while possible, totally misses the point of what wxTRANSLATE() is sometimes
needed for.

Added in:
bf2d923 (...; use wxTRANSLATE instead of wxGetTranslation for the 'Bad luck...'
literal, 2009-01-16)
7256e9b (...; add some notes about the logic of the program, 2009-01-16)

Also, GNU gettext -- modern versions, at least -- do not look for _() by
default, so the comment about xgettext knowing of it is inaccurate.
085c26a (updated Japanese translation, minor changes to the code, 2003-03-29)
2024-11-13 12:20:31 +02:00
Lauri Nurmi 3a9047ce51 Remove outdated and irrelevant information
Today, mailing list is not the place to submit new translations.

Nobody needs to grab GNU gettext from a GNU mirror and compile it from
source in order to use it.

Trusting people to find the right way to achieve these goals without
explicit instructions in internat sample's readme.txt. (Instructions that
might once again get outdated unnoticed.)
2024-11-13 12:20:28 +02:00
Lauri Nurmi be7b3b5ef1 Fix gettext instructions in readme.txt
Write xgettext's output to .pot, not .po. Initialize a .po properly,
instead of leaving it up to the translator to set all the header fields'
values.

When updating the translation, do not use xgettext for it, as it will
overwrite all the header fields with default values. Use msgmerge instead.

Do not mention wxstd.pot at all here; keep these instructions focused on
one thing.

Do not use -C for xgettext, nor stress how important it is, as it is
remarkably unimportant here. The source file's language is correctly
auto-guessed to be C++, by the file extension.

Use msgfmt with -c, which is important to ensure valid syntax.
2024-11-13 10:29:56 +02:00
Lauri NurmiandVadim Zeitlin 1ba62a6e78 Fix non-ASCII msgids with wxGETTEXT_IN_CONTEXT_PLURAL
The compilation fix in PR #24925, a47b560 (Fix
wxGETTEXT_IN_CONTEXT* with wxNO_IMPLICIT_WXSTRING_ENCODING,
2024-10-29) aimed for the wxNO_IMPLICIT_WXSTRING_ENCODING
case presumably also has the side effect of preventing
non-ASCII (non-English) msgids with wxGETTEXT_IN_CONTEXT_PLURAL,
also in the regular case when implicit encoding is permitted.

It is best to define wxGETTEXT_IN_CONTEXT_PLURAL separately for
both wxNO_IMPLICIT_WXSTRING_ENCODING and without it, similarly
to how wxGETTEXT_IN_CONTEXT is defined. For some reason it
was defined only once until now.

This commit reverts the definition of
wxGETTEXT_IN_CONTEXT_PLURAL for the regular case to what it
was before.

Closes #24944.
2024-11-10 15:56:56 +01:00
Lauri NurmiandVadim Zeitlin fd28beb2fa Define wxPLURAL regardless of WXINTL_NO_GETTEXT_MACRO
The purpose of WXINTL_NO_GETTEXT_MACRO is, as I understand it, to avoid
name clashes between _() and symbols with the same name introduced by
other libraries or compilers.

Although wxPLURAL has forever (15d0695 (added wxPLURAL() macro,
2005-06-01)) been conditionally defined, there is no similar need with it.
wxPLURAL has a longer name, and is wx-prefixed. The other, more recently
introduced translation macros are not conditionally defined, which makes
wxPLURAL inconsistent in this regard.

Closes #24943.
2024-11-10 15:53:47 +01:00
Lauri NurmiandVadim Zeitlin a47b560fd4 Fix wxGETTEXT_IN_CONTEXT* with wxNO_IMPLICIT_WXSTRING_ENCODING
The call to wxGetTranslation() was ambiguous. Fix this by adding missing
wxASCII_STR() for all string literal arguments in wxGETTEXT_IN_CONTEXT
and wxGETTEXT_IN_CONTEXT_PLURAL, just as it is used in _().

Also test that all translation macros expand to compilable code
when wxNO_IMPLICIT_WXSTRING_ENCODING is enabled.

See #1312 and also #24916.

Closes #24925.
2024-11-01 16:35:06 +01:00
Lauri NurmiandVadim Zeitlin 795c02c498 Make wxWARN_UNUSED work with Clang (again)
Checking for availability of 'warn_unused' using __has_cpp_attribute
evaluates to false with Clang, even when the attribute is actually
available. __has_attribute gives the correct result, so use it instead,
despite the aesthetic inconsistency with other checks.

See #24833.

Closes #24907.
2024-10-28 17:39:21 +01:00
Lauri Nurmi 86dae550cf Add a trivial test for wxArchiveIterator::operator=()
It is necessary to call operator=() in tests to ensure it even
compiles.
2024-10-28 12:27:14 +02:00
Lauri Nurmi c70a281c33 Fix compilation of <wx/archive.h> on Clang 19 on Fedora
Clang 19.1.0 on Fedora Rawhide fails to compile <wx/archive.h>
because m_rep's members are accessed as if m_rep was not a pointer,
but it is.

This is obviously wrong with any compiler, but apparently because
wxArchiveIterator is a template class, and its operator=() is
never called in tests, its brokenness went unnoticed.
2024-10-28 12:26:31 +02:00
Lauri Nurmi 00df4754fd Add the wxWARN_UNUSED attribute for wxDateTime 2024-10-10 20:21:38 +03:00
Lauri Nurmi 55f0b7f9a8 Add the wxWARN_UNUSED attribute for wxArrayString 2024-10-10 20:21:32 +03:00
Lauri Nurmi 0a75b8a4b7 Add the wxWARN_UNUSED attribute for wxLongLong, wxULongLong 2024-10-10 20:21:25 +03:00
Lauri Nurmi 1d0e1b69cd Add the wxWARN_UNUSED attribute for wxSize, wxRect, wx(Real)Point; remove unused 2024-10-10 20:21:18 +03:00
Lauri Nurmi a76d664283 Add the wxWARN_UNUSED attribute for wxStringTokenizer; remove unused 2024-10-10 20:21:12 +03:00
Lauri Nurmi 463d903b23 Add the wxWARN_UNUSED attribute for wxColour; remove unused 2024-10-10 20:21:06 +03:00
Lauri Nurmi ee978a1f6f Use unused variables like they were likely meant to be used
No actual changes to the test, a slight change of tone with one colour
scheme in the propgrid sample.
2024-10-10 20:20:02 +03:00
Lauri NurmiandVadim Zeitlin a73504cdc5 Enable the possibility to warn about unused wxStrings
Use the wxWARN_UNUSED attribute in wxString's definition. Compilers do not
typically warn about unused non-POD objects, but this attribute makes it
possible (on GCC and Clang).

Whether a warning is actually shown or not still depends on whether
the user has enabled warnings for unused variables in their compiler flags.
2024-10-10 02:31:51 +02:00
Lauri NurmiandVadim Zeitlin a2e2bc57c9 Add macro wxWARN_UNUSED to stand for the attribute 'warn_unused'
Also known as [[gnu::warn_unused]].

Use __has_attribute to check availability of the attribute. (Is available
on recent GCC and Clang versions, not available on MSVC.)
2024-10-10 02:31:51 +02:00
Lauri Nurmi 007787c3a8 Remove unused wxString variables
A few were removed tests/, which might have existed for readability.
2024-10-02 00:31:08 +03:00
Lauri NurmiandVadim Zeitlin 4d5fe6f9b5 Add missing #include "wx/string.h" for wx/sysopt.h
wxSystemOptions depends on wxString, but wx/string.h is not included,
except via wx/object.h when WXBUILDING is not defined.

Closes #24806.
2024-09-15 19:15:50 +02:00
Lauri Nurmi fe18212385 Do not use !str for checking wxString emptiness
While wxString::operator!() is a documented alternative to .empty() since
25 years, using it in just a handful of places in the codebase is not
consistent.

!str is arguably not very readable either, because std::string does not
have such an operator, and neither does e.g. Qt's QString. People would
generally except ! in the context of any kind of strings to check for null
pointer (char*), or an optional with a missing value (std::optional).
2024-09-12 10:05:33 +03:00
Lauri NurmiandVadim Zeitlin 8fc8ec1979 Use CRT for dates > 2038 in wxDateTime::Set() if time_t is 64-bit
MSVC claims to support dates up to 3000; what glibc, OSX, or other *nix
claim is unknown, but they shouldn't do any worse than our own code and
can do better.

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
2024-04-14 16:56:50 +02:00
Lauri NurmiandVadim Zeitlin 1055e77f9b Return values beyond Y2K38 in GetTicks(), when time_t is 64-bit
This is very essential, since otherwise GetTicks() would become
practically useless at Y2K38, i.e. less than 14 years from now.

Also remove redundant cast of TIME_T_FACTOR, which is already
long, and does not need to be explicitly cast to long.
2024-04-14 16:51:57 +02:00
Lauri NurmiandVadim Zeitlin 52cd3aeb5b Use wxInt64 instead of time_t for gmticks of testDates
This allows successfully running the tests with dates beyond Y2K38,
when time_t is 32-bit.
2024-04-14 16:51:57 +02:00
Lauri NurmiandVadim Zeitlin 5b75a347da Add a test date beyond Y2K38 but within this century 2024-04-14 16:51:57 +02:00
Lauri Nurmi 5326f285c7 Always post notification dismissal event on Gtk, regardless of reason
For an unknown reason, the Gtk implementation only used to post a
wxEVT_NOTIFICATION_MESSAGE_DISMISSED event if the associacted reason
code was either 1 or 2. To be consistent with with MSW, post the
event regardless of what the reason was, potentially enabling the
event for reasons ByApp and Unknown.
2024-03-21 09:24:23 +02:00
Lauri Nurmi 8b26611c64 Expose reason for notification dismissal through SetInt()
On all platforms, except macOS, the reason why a notification was
dismissed is known. Specifically, it can be useful to distinguish whether
the notification closed because of a timeout, or a click by the user.
2024-03-20 22:45:56 +02:00
Lauri NurmiandVadim Zeitlin 1bef48229e Fix duplicate accelerator for the font dialog in dialogs sample
Shift-Ctrl-N was already taken when it was added for the font dialog in
9b25ed0 (Add an accelerator for the font dialog in the dialogs sample,
2022-04-16). Use Shift-Ctrl-J instead.

Closes #24324.
2024-02-16 00:29:47 +01:00
Lauri NurmiandVadim Zeitlin 1864a49dd2 Fix dialogs sample never exiting with a persistent taskbar icon
If the latest user notification shown was shown with
"Use persistent taskbar icon" toggled on, the application process
would never really exit after closing. So delete m_taskbarIcon
in destructor.

Closes #24316.
2024-02-16 00:23:24 +01:00
Lauri NurmiandVadim Zeitlin 99bc43cefe Introduce minimal MSW ARM support
wxMSW could already be compiled for ARM with MSVC, but due to not
defining any ARCH_SUFFIX for ARM, makefile.vc used to place objectsi
and libraries to the same folder as x86 objects and libraries.

A completely different question is what kind of Windows runs on 32-bit
ARM, and whether one can run regular desktop apps on it.

This commit mimics what f69dbaa1 did for ARM64, and adapts it for ARM.

Closes #24222.
2024-01-21 01:48:16 +01:00
Lauri NurmiandVadim Zeitlin 2b0ee48ef7 Fix double negatives used with 'neither'
Replace most 'neither' words introduced after 66916c74a3 (Fix double
negatives used with 'neither' in docs and comments, 2022-08-15) with
'either'.

All changes are to comments only.

Closes #24090.
2023-11-30 02:31:42 +01:00
Lauri NurmiandVadim Zeitlin 3e4946fc31 Minor documentation syntax and orthography fixes
Closes #23759.
2023-08-22 19:20:33 +02:00
Lauri NurmiandVadim Zeitlin 9f94f4069c Support wxDP_DROPDOWN mode for native date pickers on macOS
According to Apple's documentation, the presentsCalendarOverlay property
is supported in macOS 10.15.4 and later.

Closes #23520.
2023-05-05 15:19:49 +02:00
Lauri Nurmi 88cf7653fa Fix/workaround for wxLocale breaking Unicode string formatting 2023-04-18 01:04:01 +03:00
Lauri Nurmi aefd1e41c7 Attempt to test whether wxLocale breaks formatting Unicode strings 2023-04-17 02:04:59 +03:00
Lauri NurmiandVadim Zeitlin cf66709e5f Use © instead of (c) in wxGetLibraryVersionInfo()
See #23265.
2023-02-20 18:31:15 +01:00
Lauri NurmiandVadim Zeitlin f7d0742715 Use translation context for more standard OSX menu items
Similar items were added context in d85f0e311d (Use translation context
for standard OSX menu items, 2022-05-02) but some were missed back then.

The context primarily serves as a translator comment, informing that these
are indeed OSX menu item names, and not something else.

Also to match the established translations of OSX itself, for some
languages these may need to be translated using particular terminology
different than on other platforms.

See #23213.
2023-02-03 15:03:04 +01:00
Lauri Nurmi cbee89b3d2 Fix and/or complete OSX menu item translations for Finnish 2023-02-02 22:27:59 +02:00
Lauri Nurmi d8114d2176 Fix double-UTF8 comment line in fi.po 2023-02-02 21:54:59 +02:00
Lauri Nurmi 0316ead300 Fix non-fuzzy keyboard key names that are clearly wrong for Finnish
The translations make sense in another context, but not as key names. Also
one typo.
2023-02-02 21:54:58 +02:00
Lauri NurmiandLauri Nurmi ed897d9641 Restore value of errno after wxString::ToInt()/Long()/etc.
Such functions modifying errno is undocumented, and may come
as a surprise to the caller. Consequently also a call to
wxString::Format() would modify errno.
2023-01-06 18:04:53 +02:00
Lauri NurmiandVadim Zeitlin fc499810ce Use wxChoice for month selection in wxGenericCalendarCtrl
For no obvious reason the generic calendar control used
a read-only wxComboBox until now.

While this is more or less identical to a wxChoice on MSW,
it is somewhat different on OSX and Gtk: Whereas a wxChoice
can be opened by clicking anywhere on it, a wxComboBox requires
clicking on the arrows on the right edge. A wxComboBox
allows selecting and copying the current value, but this is
probably not terribly useful in a calendar.

See #22853.
2022-10-09 23:57:57 +02:00
969b1fad4c Fix more double negatives used with 'neither'
In many cases it should be 'either'.

No changes to actual code.

Complements #22723, which focused on API docs and comments in C++ code.

Co-authored-by: Ian McInerney <ian.s.mcinerney@ieee.org>

See #22798.
2022-09-18 18:02:07 +02:00
Lauri NurmiandVadim Zeitlin 66916c74a3 Fix double negatives used with 'neither' in docs and comments
In many cases it should be 'either', and 'nor' should be 'or'
accordingly.

No changes to actual code.

Closes #22723.
2022-08-19 16:22:21 +02:00
Lauri NurmiandVadim Zeitlin d2094440e4 Silence warnings about unused variables on SunOS
No real changes.

Closes #22556.
2022-06-21 14:24:45 +02:00
Lauri Nurmi 83c6edcc32 Always call wxSecureZeroMemory() to wipe memory in wxSecretValue
Replaces a call to MSW native ::SecureZeroMemory(), and calls to plain
memset().
2022-06-04 15:14:09 +03:00
Lauri Nurmi d85f0e311d Use translation context for standard OSX menu items
The context primarily serves as a translator comment, informing that these
are indeed OSX menu item names, and not something else.

Also to match the established translations of OSX itself, for some
languages these may need to be translated using particular terminology
different than on other platforms.
2022-05-31 21:32:23 +03:00
Lauri NurmiandVadim Zeitlin cb527f5b1f Do not assemble OSX menu item translations from pieces
Just spell out "Quit Application" and "Hide Application" as is,
without string concatenation.

Translating individual words can be complicated with some languages.

This change affects the case when wxTheApp is NULL, which presumably
is quite rare.

Closes #22384.
2022-05-03 18:10:16 +02:00
Lauri Nurmi 180b8e5183 Mark system cursor names translatable in a context, and do get translation
It looks like wxGetTranslation() was not actually called for these strings
earlier, so do call it.

The context fulfills also the same purpose as TRANSLATORS: comments --
removing comments as redundant.
2022-04-24 11:30:31 +03:00
Lauri Nurmi 3396a40015 Mark keyboard key names translatable in a specific context
Many key names are short and commonly used words; e.g. "Delete", "Left",
"Right", "Pause", "Menu", "End".

It is not at all unlikely that such words could be used in a completely
different meaning elsewhere in the code. That is why this list of
keys should be assigned a context.

The context fulfills also the same purpose as TRANSLATORS: comments --
removing comments as redundant.
2022-04-24 11:30:31 +03:00
Lauri Nurmi e3bf759615 Add wxTRANSLATE_IN_CONTEXT() macro for marking strings for translation
Similarly to wxTRANSLATE(), this macro does not do much itself.
2022-04-24 11:30:31 +03:00
Lauri NurmiandVadim Zeitlin 87d6763209 Generate mouse events for Aux1, Aux2 buttons on OS X
OS X supports 5-button mice out-of-the-box.

Closes #22286.
2022-04-08 00:36:02 +02:00
Lauri Nurmi fdd05c8b8b Parse also time zone in ParseDateTime(), if found
Accept the same kind of time zone specifiers that RFC822 timestamps
accept; most importantly the "+0200" style.

Added more tests, and changed the way tests compare dates:
Since some timestamps now specify a time zone, those need to be compared
as UTC to avoid the system's time zone affecting the tests. Others can
still be compared as local time, as before.
2022-03-22 19:12:48 +02:00
Lauri Nurmi 136b1713e1 Refactor time zone parsing into a separate function from ParseRfc822Date()
For now, the new function is private and undocumented.
2022-03-22 19:12:45 +02:00
Lauri Nurmi 770cf26afe Fix out-of-bounds with military and truncated time zones; add more tests
Out-of-bounds was already covered by the fact that the date is appended 32
zero-bytes in ParseRFC822Date() as a safety measure. But now the time zone
parsing section of the function no longer relies on those extra zeros
being present.

Added tests for RFC822 timestamps with military time zones, and more types
of truncated, invalid time zone specifiers.
2022-03-22 19:11:22 +02:00
Lauri Nurmi 89eec3cb80 Fix truncated time zone specifier tests for ParseRFC822Date()
Correction to the commit:
2153ffc (Test ParseRFC822Date() with truncated time zone specifiers,
2022-03-19)

The inputs failed as expected, but due to an unrelated reason (missing
comma).
2022-03-22 19:09:23 +02:00
Lauri NurmiandVadim Zeitlin 088e643d37 Do not consume whitespace/delimiters after date in DateParse()
Set the end iterator to the end of the actually parsed date, instead
of consuming any ultimately unparsed whitespace/delimiters possibly
following the date.
2022-03-19 22:56:08 +01:00
Lauri NurmiandVadim Zeitlin 945738042d Fix ParseDate() for dates having day expressed as an ordinal
Previously the year was left unparsed, and the current year was
incorrectly used even when the input provided a year.
2022-03-19 22:56:08 +01:00
Lauri NurmiandVadim Zeitlin 700d763ebc Test ParseDate() with dates containing a weekday
Test both a weekday that matches the date, and one that does not.
2022-03-19 22:56:08 +01:00
Lauri NurmiandVadim Zeitlin 4cf335340c Test the end iterator set by Parse{Date,Time,DateTime}()
In other words, check that the unprocessed part of the input is what
we expected.

Also add some cases where a valid date or time is followed by something.
2022-03-19 22:56:07 +01:00
Lauri NurmiandVadim Zeitlin 23b8ec6d9a Test ParseRFC822Date() with truncated time zone specifiers 2022-03-19 22:56:07 +01:00
Lauri NurmiandVadim Zeitlin 504c0b16c3 Fix ParseDateTime() to also accept time + date, in that order
The intent of the implementation clearly is to allow parsing time first,
date second. But this failed, because a time such as "14:30:15" would
successfully parse as a date (as 14th of current month, current year).

Consequently an attempt is made to parse the actual date as time, which
fails, and therefore the whole ParseDateTime() fails.

Adding a failing test case for ensuring times cannot be parsed as dates
does not cause a failure, because partially yet successfully parsed inputs
get silently ignored (in both ParseDate and ParseDateTime tests). Fixing
both of these, too.

Closes #22203.
2022-03-18 00:01:18 +01:00
Lauri NurmiandVadim Zeitlin 538a75fe4e Decode 2-digit years properly in ParseRfc822Date()
The RFC accepts 2-digit years, and it makes most sense to interpret
e.g. 95 as 1995. However, this is an incompatible change, as earlier
95 was literally decoded as 95 AD.

Years 00..29 are considered to mean 20xx; 30..99 means 19xx.

Closes #22196.
2022-03-17 23:55:57 +01:00
Lauri Nurmi 1c5e66a12c Allow RFC822 timestamps without a week day
RFC 822 specifies the week day is optional.
2022-03-10 19:25:21 +02:00