Commit graph

20313 commits

Author SHA1 Message Date
Vadim Zeitlin
5f45e697bd Don't use wxWxCharBuffer any more
We still provide this #define, but there is no reason to use it inside
the library itself, so replace it with the more clear wxWCharBuffer.

No real changes.
2022-10-28 21:17:52 +01:00
Vadim Zeitlin
c5f8cefe1e Remove another not really UTF-8 related FIXME comment
The question of which type should be used in the absence of the format
string still seems to be valid, but not really related to using (or not)
UTF-8.

Leave the comment, but remove the FIXME, as it almost certainly won't be
fixed (but hopefully all this code might get removed as part of #22880).

Also replace a leftover NULL with nullptr for consistency and to pacify
the code style check.
2022-10-28 21:17:15 +01:00
Vadim Zeitlin
68a05fd5b8 Don't mention ANSI build in wx/strvararg.h comments any longer
Also remove an "#else" branch which is never taken any more.

No real changes.
2022-10-28 21:17:15 +01:00
Vadim Zeitlin
2d1928e6aa Correct misleading comment for wxString::IsSameAs() overloads
They can't be removed as doing it would result in errors when compiling
any code using IsSameAs() due to ambiguous conversions.
2022-10-28 21:17:15 +01:00
Vadim Zeitlin
d81c99f344 Remove FIXME-UTF8 comments from wx/list.h
This is never going to be "fixed" as this entire class will be removed,
so remove a FIXME comment which remained there for the last 15 years.
2022-10-28 21:17:15 +01:00
Vadim Zeitlin
53018abc27 Don't mention ANSI build in comments in wx/chartype.h any more
Also remove a FIXME-UTF8 which wasn't really relevant, this looks like a
good enough place for the check of wxUSE_UTF8_LOCALE_ONLY consistency.

No real changes.
2022-10-28 21:17:15 +01:00
Vadim Zeitlin
37418eed8e Replace wxWritableCharBuffer template with 2 simpler classes
This addresses a FIXME comment in this template, it was written in a
generic form to compile in both Unicode and ANSI builds of the library,
but now it can be written more simply and efficiently (in the "char"
case).

No real changes.
2022-10-28 21:17:15 +01:00
Vadim Zeitlin
3bc0d1ed92 Deprecate unused wxMBConv parameters in wxString functions
Some wxString functions using wide strings still took wxMBConv just for
consistency with the same functions taking narrow strings in ANSI build,
but this doesn't really make sense any longer because the same code
can't be compiled with different values of wxChar -- it is always the
same thing as wchar_t now, and so we shouldn't pass unused conversion
objects to these functions any more.

So give deprecation warning when these functions are used (but without
formally deprecating them, as it doesn't cost much to keep them) and
avoid using them in the library code.
2022-10-28 21:16:10 +01:00
Vadim Zeitlin
f36e414072 Remove misleading comment for wxArchiveClassFactory::SetConv()
This conversion object is not used just in the ANSI build, but also in
Unicode one, so it can't be removed without changing the behaviour of
the code.
2022-10-28 19:15:30 +01:00
Vadim Zeitlin
cf474d7f48 Remove wxOnAssert() overload used in ANSI build only
This could be also used by the applications if they decided to call it
directly, for whatever reason, but, hopefully, this shouldn't be a
common occurrence, as passing wide file name is really inconvenient, and
it was deprecated since 2.8, so should be safe to remove by now.
2022-10-28 18:38:41 +01:00
Vadim Zeitlin
919a8cbb27 Remove "encoding" argument from string-oriented wxOSX functions
This was needed in ANSI build only and so isn't needed any longer now
that it's not supported any more, so simplify the code and stop passing
fonts/encodings everywhere when we don't actually need them at all.
2022-10-28 01:35:34 +02:00
Vadim Zeitlin
c78b0d652b Remove UNICODE build option, hardcode its value as 1
Also hardcode "u" suffix for the library names -- it doesn't make sense
any longer, but we need to keep it for compatibility.
2022-10-27 19:43:59 +02:00
Vadim Zeitlin
53b3b979fe Remove tests for _UNICODE too
It is now always defined, so testing for it is useless.

Give an error in MSVC-specific header if it is not defined as it should
be.
2022-10-27 19:43:30 +02:00
Vadim Zeitlin
81807382b7 Remove all wxGTK_CONV macros except for wxGTK_CONV_FN
Use wxString::utf8_str() and FromUTF8() directly, there is no need for
the macros abstracting the difference between ANSI and Unicode builds
any longer.
2022-10-27 19:43:30 +02:00
Vadim Zeitlin
813fcbaf10 Remove wxUxThemeFont, it is useless now
This helper class converted between LOGFONTA and LOGFONTW, but not we
only ever use the latter.
2022-10-27 19:43:30 +02:00
Vadim Zeitlin
4519d8e08a Remove wxUSE_UNICODE checks as they're always true now
Also remove all code guarded by "#if !wxUSE_UNICODE".
2022-10-27 19:43:30 +02:00
Vadim Zeitlin
5d3e5ccf32 Always define wxUSE_UNICODE as 1
Remove the option allowing to set wxUSE_UNICODE to 0.
2022-10-27 01:04:15 +01:00
Artur Wieczorek
811cdc0ffc Use wxString() rather than wxEmptyString in wxPropertyGrid classes 2022-10-26 13:11:59 +02:00
Artur Wieczorek
3610bde8e2 Guard functions with wxCHECK macros rather than wxASSERT 2022-10-26 12:09:23 +02:00
Artur Wieczorek
2369557963 Use wxVariant() instead of wxNullVariant 2022-10-26 12:07:39 +02:00
Artur Wieczorek
2282594f24 Get rid of unnecessary variable assignment 2022-10-26 12:06:57 +02:00
Artur Wieczorek
db31a01615 Get rid of commented out code 2022-10-26 12:05:42 +02:00
Vadim Zeitlin
5845312825 Merge branch 'generic-listctrl-hidpi-images'
Support high DPI images in generic wxListCtrl.

See #22916.
2022-10-26 02:39:28 +02:00
Vadim Zeitlin
7ae2281874 Merge branch 'bitmap-macro'
Fix wxBITMAP() in wxQt and improve its documentation.

See #22911.
2022-10-25 23:52:21 +02:00
Vadim Zeitlin
99c52403f9 Use usual half-open interval for wxID_LOWEST..wxID_HIGHEST
The reserved wx IDs were previously in (wxID_LOWEST, wxID_HIGHEST]
range, which was very unusual, as C++ always uses intervals half-open in
the other direction, i.e. [begin, end).

It also conflicted (in theory, if not in practice, as wxID_HIGHEST
wasn't actually used for anything) with the common practice, used even
by wx own samples, of starting the custom IDs at wxID_HIGHEST rather
than wxID_HIGHEST+1.

So change this to use the standard convention, retroactively making all
the code using wxID_HIGHEST valid -- this seems better than insisting on
starting the IDs from wxID_HIGHEST+1.

Closes #22909.
2022-10-25 23:51:21 +02:00
Vadim Zeitlin
6dd4e73ea3 Add wxDrawImageBitmap() helper and use it in wx{List,Tree}Ctrl
Add a helper function calling wxDC::DrawBitmap() and hiding its ugly
"useMask" boolean parameter which was also error-prone, e.g. some
recently modified code passed wxIMAGELIST_DRAW_TRANSPARENT to it by
mistake.

No real changes, this is just a refactoring.
2022-10-25 23:48:25 +02:00
Gerhard Stein
502e189f47 Support high DPI bitmaps in wxGenericListCtrl
Use wxWithImages::GetImageBitmapFor() instead of wxImageList in this
control code to ensure that we use the provided high DPI bitmaps, if we
have them, instead of always scaling up the fixed-size image list
images.

Closes #22907.
2022-10-25 23:48:25 +02:00
Artur Wieczorek
ee70221a0d Handle wxOSX-specific clipping in wxOSX wxWindowDC implementation
Instead of setting clipping for client area for wxOSX windows
with non-native borders in the common wxGCDC::DestroyClippingRegion()
we can encapsulate this operation in dedicated DestroyClippingRegion()
implementation in wxWindowDC.

See #19108.
See #22914.
2022-10-25 10:50:40 +02:00
Vadim Zeitlin
4eae6b7ff1 Improve wxBITMAP() documentation
Document wxHAS_IMAGE_RESOURCES and talk about wxBITMAP_PNG() before
wxBITMAP() instead of doing it as only an afterthought.
2022-10-23 16:31:52 +02:00
Vadim Zeitlin
95b6e1270e Fix wxBITMAP() definition for wxQt
Define wxBITMAP() for all non-MSW ports in the same, working, way
instead of using a weird definition which happened to accidentally work
before for wxQt due to implicitly using wxImage ctor from XPN, but
doesn't work any longer since the changes of 5e53f74af1 (Make wxImage
ctor from XPM data explicit, 2021-04-17).

Closes #22908.
2022-10-23 16:07:25 +02:00
Vadim Zeitlin
adb29b1903 Merge branch 'scintilla_3.10.5' of https://github.com/MaartenBent/wxWidgets
Upgrade Scintilla to 3.21.1.

See #1331.
2022-10-23 16:03:31 +02:00
Vadim Zeitlin
4e52fbc4b5 Merge branch 'qt-fixes'
Various wxQt build fixes.

See #22902.
2022-10-23 15:55:03 +02:00
PB
c22f6ba4fc Update comments in setup_inc.h and various wx/setup.h files
Update the outdated or just plain incorrect comments.

Closes #22857.
2022-10-23 15:00:38 +02:00
Maarten Bent
f02a43076f
Fix compiling wxSTC
Add missing namespaces and includes.
Use correct parameter types.
Remove overridden methods that do not exist anymore.
Add methods that do need to be overridden (without implementation).
Update listbox action implementation.
SCI_LOADLEXERLIBRARY is now handled inside ScintillaBase::WndProc.
Cleanup includes, use copy from ScintillaWin.cxx for scintilla includes.
2022-10-22 20:06:03 +02:00
Maarten Bent
314fe7e4fc
Update and run wxSTC python scripts
Remap scintilla enums to int.
Add implementations for function using scintilla::stringresult.
Silence warnings: Unknown line type: ali
2022-10-22 20:05:53 +02:00
Vadim Zeitlin
e28ab8974d Avoid some simple to fix deprecation warnings with Qt 5.14
Replace the deprecated functions with the new equivalents when this
doesn't really change the code semantics.

Also add new compat.h private header where more functions like
wxQtGetWidthFromMetrics() can be added in the future.

There are still quite a few of deprecation warnings requiring more
changes remaining.
2022-10-21 19:00:36 +02:00
Vadim Zeitlin
7ef80d2474 Merge branch 'catch-2.x'
Switch to using CATCH v2 for the tests.

See #22874.
2022-10-18 21:56:52 +02:00
Vadim Zeitlin
2de6e8b191 Merge branch 'generic-treectrl-hidpi'
Generic wxTreeCtrl icons high DPI improvements.

See #22887.
2022-10-18 21:55:32 +02:00
Vadim Zeitlin
b2050fcb6f Update to Catch v2
Use Catch2 public header instead of using internal Catch v1 headers: we
can do this now because Catch2 supports (albeit in a rather ugly way)
being used with PCH.
2022-10-18 18:39:13 +02:00
Vadim Zeitlin
715b2cd48c Use wxSTATEMENT_MACRO_BEGIN/END in wx/catch_cppunit.h
This is more clear and doesn't rely on internal Catch::alwaysFalse()
which doesn't exist in Catch v2.x any more.
2022-10-18 18:39:13 +02:00
Vadim Zeitlin
9f46e67eec Merge branch 'nullptr'
Use nullptr instead of NULL in the code, comments and the documentation.

See #22881.
2022-10-18 18:34:07 +02:00
Vadim Zeitlin
c2eab06e4b Merge branch 'remove-motif-and-gtk1'
Remove obsolete and unmaintained wxMotif and wxGTK1 ports.

See #22877.
2022-10-18 18:30:58 +02:00
Vadim Zeitlin
65e4be6f82 Add wxWithImages::GetImageLogicalSize() helper too
This is similar to the just added GetImageBitmapFor() and works both
when using legacy wxImageList and wxBitmapBundle.

Use the new function in wxGenericTreeCtrl code.
2022-10-18 18:08:08 +02:00
Vadim Zeitlin
087fc9fc5c Add helper wxWithImages::GetImageBitmapFor()
This function is simpler to use than calling GetBitmapBundle() first and
then calling GetBitmapFor() on it, avoids creating a temporary
wxBitmapBundle unnecessarily when wxImageList is used and, most
importantly, is public and not protected, which will allow
wxGenericTreeCtrl to use it for the other image lists than the main one.

The slightly unwieldy name is due to trying to use "Image" in all public
functions of this class, which should hopefully minimize clashes with
any user-defined functions that may exist in the classes deriving from
it, without requiring the use of even uglier "WX" prefix.

No real changes yet.
2022-10-18 18:06:53 +02:00
Vadim Zeitlin
4f4c5fcfdf Use nullptr instead of NULL in the code and documentation
This is a combination of running clang-tidy with modernize-use-nullptr
check for some ports (GTK, X11, OSX) and manual changes to the ports for
which it couldn't be used easily (MSW, DFB) and also manually updating
the docs.

Also replace NULL with null or nullptr in the comments as this is more
consistent with the use of nullptr in the code and makes it simpler to
grep for the remaining occurrences of NULL itself.

And also use null in the assert messages.

Only a few occurrences of "NULL" are still left in non-C files, mostly
corresponding to unclear comments or string output which it might not be
safe to change.
2022-10-18 01:25:25 +02:00
Vadim Zeitlin
e3cf23e945 Merge branch 'msw-composited-fixes'
Fix regressions in wxMSW after enabling WS_EX_COMPOSITED and document
this change.

See #22882.
2022-10-18 00:38:09 +02:00
Vadim Zeitlin
ec830fffec Deprecate wxQsort()
This function is not really useful and doesn't seem to be used anywhere.
2022-10-17 18:51:20 +02:00
Vadim Zeitlin
e5d999963d Remove wxQSORT_DECLARED hack
This is not needed any longer since we don't need wxQsort() in
wx/vector.h any more after eb97bf90e4 (Remove custom wxVector
implementation, 2022-10-11).
2022-10-17 18:38:15 +02:00
Vadim Zeitlin
b5d434dc91 Move wxListCtrl::MSWResetParentComposited() to wxWindow
This function will need to be used from other places too, so make it
available in the base class itself.

Also disable WS_EX_COMPOSITED for this window itself too.
2022-10-17 13:31:28 +01:00
Vadim Zeitlin
ff629f3853 Fix drawing wxListCtrl since enabling double buffering by default
We need to avoid using WS_EX_COMPOSITED for any of the parents of this
native control and not just for the control itself.
2022-10-16 21:26:33 +01:00