Commit graph

7922 commits

Author SHA1 Message Date
Vadim Zeitlin
a2f7a933e8 Merge branch 'no-global-ops'
Don't define operators for wx types in global scope.

This results in much better error messages when the compiler gives an
error about failing to resolve a call to some operator in user code
because it doesn't list all the wx-defined operators as candidates. In
practice, this cuts down error messages from 500 (!) lines to 2 with
gcc.

See #24190.
2024-01-12 18:42:39 +01:00
Vadim Zeitlin
6586afb0a5 Use XDG-compliant location by default in wxFileConfig
Still use the traditional dot file if it already exists, but prefer
using the new location otherwise, i.e. for the new program installation.

Add wxCONFIG_USE_HOME to allow forcing the use of the old location if
really necessary.

Also use the new style as default "old style" of MigrateLocalFile() so
that calling it even when using XDG layout in wxStandardPaths still
works as expected.
2024-01-08 00:43:26 +01:00
Vadim Zeitlin
b294a6b2bc Merge branch 'config-xdg'
Make it easier to use wxFileConfig in XDG-compliant way.

See #24180.
2024-01-07 16:13:15 +01:00
Vadim Zeitlin
ebe0847932 Add wxHAS_CONFIG_AS_{REG,FILE}CONFIG symbols
Sometimes it's useful to have some code used only if wxConfig is defined
as wxRegConfig or only if it is defined as wxFileConfig and testing for
these symbols is more clear than testing for the platform (and more
correct, considering that setting wxUSE_CONFIG_NATIVE to 0 may result in
wxFileConfig being used even under Windows).
2024-01-04 02:55:05 +01:00
Vadim Zeitlin
e21b27019f Merge branch 'mac-build'
Improve Mac build documentation and build itself.

See #24128.
2024-01-03 20:27:00 +01:00
Vadim Zeitlin
acf113f3f9 Update copyright years to 2024
Just run misc/scripts/inc_year and commit the results.

See #18690.
2023-12-31 18:56:06 +01:00
Paul Cornett
ce1d317768 Remove GLU dependency
See #23721
2023-12-28 14:49:42 -08:00
Viachaslau Lisouski
ca405352e0 Add wxFileSystemHandler for "data" scheme
This notably allows embedding images directly in HTML.

Closes #24138.
2023-12-18 22:19:11 +01:00
Vadim Zeitlin
30994678c4 Reduce the degree of make parallelism in examples
And add a warning to not do this if it's not supported.
2023-12-12 20:10:40 +01:00
Vadim Zeitlin
1d9fe90224 Add section about building release Mac libraries
This doesn't seem to be documented anywhere else, but is rather
important to know.
2023-12-11 18:49:29 +01:00
Vadim Zeitlin
8d8ee12683 Recommend building just "minimal" sample
Don't tell people to build all the samples and demos because this takes
time and some of them are badly outdated. Do tell them to build and run
the minimal one to check that things work as intended.

Also remove links to the wiki from wxOSX instructions, there is not much
useful from non-archaeological point of view there.
2023-12-11 18:43:20 +01:00
Vadim Zeitlin
209ce24b85 Recommend using parallel make when building wxWidgets
This should help at least some people spend less time waiting.
2023-12-11 18:38:22 +01:00
Vadim Zeitlin
e4f2b1eaac Clarify description of archive contents in wxMSW binaries docs
Don't say that the directory where the archives are unpacked shouldn't
contain anything else than include and lib directories, as it can/does
contain other files, such as wxwidgets.props.

Closes #24098.

Co-Authored-By: Bill Forster <billforsternz@gmail.com>
2023-11-30 02:43:52 +01:00
Vadim Zeitlin
5318637839 Merge branch 'fix_SVG_premultiply' of https://github.com/teliseo/wxWidgets
Fix wxBitmapBundle::FromSVG(), which renders incorrectly on GTK and add
wxHAS_PREMULTIPLIED_ALPHA to make the code dealing with alpha more clear
and correct.

See #24097.
2023-11-30 02:35:20 +01:00
Blake-Madden
2c1cdf9c02 Fix typos and repeated words in comments and documentation
Closes #24085.
2023-11-30 02:21:34 +01:00
taler21
7a1c8d39f8 Fix references to wxEventLoop::YieldFor() in the documentation
It was incorrectly called wxAppConsole::YieldFor() but the function was
moved from wxAppConsole to wxEventLoopBase back in dde19c2180 (second
part of #10320: move wxApp event handling functions to wxEventLoopBase
(in particular move Yield() functions); add backward compatible
redirections to wxApp; update docs; remove global lists wxPendingEvents
and wxPendingEventsLocker, 2009-02-15).

Closes #24095.
2023-11-29 22:16:03 +01:00
Tim Eliseo
d21d54b42f Document new symbol wxHAS_PREMULTIPLIED_ALPHA. 2023-11-27 10:06:47 -08:00
Vadim Zeitlin
ef4fecc186 Merge branches 'tree-state-bmpbundle' and 'imglist-scalefactor'
Refactor wxImageList and convert it to use physical pixels and
add support for high DPI state images wxTreeCtrl using the new
wxImageList.

See #24000, #24033.
2023-11-17 01:03:27 +01:00
Vadim Zeitlin
53b4f4ddf2 Use physical size in wxImageList
This seems to be the only way to fix using this class, which is
fundamentally incompatible with high DPI support, with bitmaps of
different logical but identical physical sizes.

By using physical size we ensure that the code chopping up the provided
bitmap in multiple images doesn't do it with the bitmap having the same
physical size but a different logical size from all the other bitmaps.
And, conceptually, logical size of the bitmaps in it really shouldn't
matter to the image list as it doesn't have a scaling factor and so
can't do anything useful with the logical size.

Moreover, we can't add wxImageList::SetScaleFactor() neither because
this class is, by design, supposed to be shareable between different
controls which may use different scale factors, so it doesn't make sense
to speak of the scale factor of the image list itself.

This undoes the changes made in the generic implementation back in
c374eefd34 (Fold wxOSX-specific wxImageList into generic version,
2018-10-30) and also eb52e86553 (Take into account scale factor of
images added to wxImageList, 2021-04-03).

Also update a couple of places where wxImageList is still used to use
physical sizes. Unfortunately some others can't be easily fixed, e.g.
global wxFileIconsTable would have to be completely rewritten.

Finally, add a unit test checking that things work as expected now:
previously the size of 24x24 bitmap in the image list containing
(scaled) 32x32 bitmaps would be 21x21 due to sub-bitmap extraction
kicking in.

Closes #23994.
2023-11-06 21:18:34 +01:00
Vadim Zeitlin
523979b1f1 Explain that using MSVC-specific wx/setup.h is optional
It made sense to emphasize its use when this was the recommended way to
set up MSVS projects, but now the simplest (and hence recommended) way
to do it is using wxwidgets.props file, so make the manual setup
instructions more generic as they're most likely to be used with
non-MSVC compilers.
2023-11-05 02:26:58 +01:00
Vadim Zeitlin
23abd00d0b Slightly improve the example list of libraries to link with
Fix spelling error and use more forward-looking "34" in their names.
2023-11-05 02:26:58 +01:00
Vadim Zeitlin
ae91254d3e Provide MinGW-specific instructions for building applications
We had instructions for building wxWidgets with MinGW but not for
building the applications using wxWidgets, so add them too now in the
hope that it will be helpful to people who struggle to find the options
to use for building -- or at the very least to the people who have to
answer the questions about this, as they could now just point to these
instructions.
2023-11-05 02:26:58 +01:00
Vadim Zeitlin
9bfd72e7f7 Merge branch 'gtk-diag-suppress'
Fixes for suppressing bogus GTK diagnostics.

See #23923.
2023-10-02 19:34:40 +02:00
PB
4efbbce82e Modernize wxGenericDirCtrl appearance on MSW
Change wxTreeCtrl style for a control used by wxGenericDirCtrl so that
wxGenericDirCtrl looks more like the folder view in File Explorer (but
still don't show expanders for root-level items).

Also update wxGenericDirCtrl screenshot in the docs.

See also 6caaf58 (Use more modern appearance for wxMSW wxTreeCtrl by
default, 2023-09-30).

Closes #23922.
2023-10-02 19:32:02 +02:00
Vadim Zeitlin
4ffad5074f Add WXSUPPRESS_GTK_DIAGNOSTICS environment variable
This allows to suppress some or all GTK diagnostics even for the
programs not calling GTKSuppressDiagnostics() nor even
GTKAllowDiagnosticsControl() themselves.
2023-10-01 17:36:54 +02:00
PB
6caaf589f1 Use more modern appearance for wxMSW wxTreeCtrl by default
Change wxTreeCtrl default style under wxMSW to make it look more
up-to-date by default: use twisting buttons and full-row highlight and
don't display connector lines.

Using wxTR_LINES_AT_ROOT together with wxTR_NO_LINES may look odd but it
is needed because without wxTR_LINES_AT_ROOT, the buttons would not be
displayed.

Also update wxTreeCtrl screenshot in the docs.

Closes #23844.
2023-09-30 15:00:48 +02:00
Joan Bruguera Micó
19936c2176 Don't clobber std::string_view equality with char *
Make the wxString(std::string_view) constructor explicit.

Otherwise, when comparing a std::string_view with a const char *, the
cast to wxString will be considered as a candidate for the comparison,
ultimately causing an "ambiguous overload for 'operator=='" error.

For example, this sample only builds if the constructor is explicit:

  #include <wx/string.h>
  #include <string_view>

  int main() {
    std::string_view view = "abc";
    const char *str = "abc";
    return view == str;
  }

However, making the constructor explicit will break assignment:

    std::string_view view = "abc";
    wxString s;
    s = view; // Error: no match for "operator="

That we can fix by implementing operator=(std::string_view)

That, however, introduces another ambiguity:

    std::string str = "abc";
    wxString s;
    s = str; // Ambiguous between s = wxString(str)
                              and s = std::string_view(str)

That we can fix by implementing operator=(std::string)

Finally, note that some rather obscure ambiguities remain, such as:

    wxString s;
    s = {"abc", 2}; // Ambiguous between s = wxString("abc", 2)
                                     and s = std::string_view("abc", 2)

Avoiding them is not simple (https://cplusplus.github.io/LWG/issue2946)
and doesn't add much value.

Closes #23834.
2023-09-06 02:44:11 +02:00
PB
2714bf19df Update screenshot in wxSplitterWindow Overview
Use screenshot of the splitter sample under Windows 11.
2023-08-31 21:56:05 +02:00
PB
ae1bf96788 Update screenshots of controls under wxMSW in documentation
In the documentation, replace all the screenshots of various
controls under wxMSW with those on Windows 11 22H2 (light mode).
2023-08-31 21:55:31 +02:00
Vadim Zeitlin
cb99932114 Add support for specifying high DPI animations in XRC
Deprecate wxXmlResourceHandler::GetAnimation() function which returns
just a single animation and add a new GetAnimations() replacing it.

Use the new function in wxAnimationCtrl XRC handler to pass all the
animations defined in the XRC file to the control.
2023-08-25 20:51:21 +02:00
Vadim Zeitlin
d69ddb8656 Revert all recent wxUSE_DPI_AWARE_MANIFEST-related changes
This reverts 5d630caabd (Make it enough to predefine only
wxUSE_DPI_AWARE_MANIFEST, 2023-08-23) and all the commits which tried to
fix the breakage caused by it.

While the original change had merit, it seems to be too difficult to fix
all our build systems to avoid embedding manifest when defining this in
the code, like samples/sample.rc does, so revert this change for now.

Maybe it can be reintroduced in the future after switching to some other
build system.
2023-08-25 00:03:47 +02:00
Vadim Zeitlin
5d630caabd Make it enough to predefine only wxUSE_DPI_AWARE_MANIFEST
If this is predefined before including wx/msw/wx.rc, it clearly
indicates that wx manifest should be used, but this was _not_ the case
before as wxUSE_RC_MANIFEST could be predefined as 0 (which is the case
for MSVS, to avoid conflicting with the manifest embedded by it into the
executable by default).

Change this and do include the wx manifest if wxUSE_DPI_AWARE_MANIFEST
is defined.
2023-08-23 16:18:05 +02:00
PB
350222e411 Correct wxBUILD_TESTS CMake build options in unit tests docs
Provide the correct options for wxBUILD_TESTS in the CMake part
of unit tests documentation.

Closes #23745.
2023-07-31 19:18:18 +02:00
Vadim Zeitlin
a921f558d9 Remove configure.in to configure.ac
This is the extension expected by all non-ancient autoconf versions.
2023-07-24 00:11:26 +02:00
Vadim Zeitlin
9452f6b982 Remove frozen autoconf macros version a.k.a. "auto hacks"
This hasn't been maintained since 2007 and doesn't seem to be really
needed as using and not using them results in the same output currently.
2023-07-24 00:11:26 +02:00
Vadim Zeitlin
22a3a2fa66 Link to "getting the sources" from wxGTK build instructions
This should help people who check out the repository without submodules.

It's a bit circular, as the target of the link links back to this page
itself, but doing anything else would require much deeper reorganization
that can't be done now.

Closes #23683.
2023-07-21 20:57:12 +02:00
Vadim Zeitlin
94cd26ed0a Improve RUNTIME_LIBS build option documentation
State upfront that it only works with MSVC and also don't mention
msvcrt.dll not used any more since a couple of decades.

See #23715.
2023-07-21 20:40:43 +02:00
Vadim Zeitlin
e5e37d9878 Add link to the binaries instructions to the release notes
Although the release notes themselves partially repeat the information
there, the manual is more complete, so still link to it.
2023-06-30 17:55:34 +02:00
Vadim Zeitlin
de0595108a Merge branch 'bmp-dataobj-fix'
Fix crash when using wxDataObjectComposite and other clipboard-related
cleanup.

See #23659.
2023-06-30 00:20:12 +01:00
Vadim Zeitlin
8a95a93a1d Remove wxUSE_OLE_CLIPBOARD and always use OLE for wxClipboard
It doesn't make sense to keep the old and almost never used alternative
wxClipboard implementation which has known fatal bugs (such as casts of
wxDataObject that could be wxDataObjectComposite to wxBitmapDataObject,
see #23564) when wxUSE_OLE is never going to be disabled anyhow.

Note that this means wxSetClipboardData() function doesn't exist at all
any longer when previously it was available in the wxUSE_OLE==0 builds.
As the official builds always used wxUSE_OLE==1, this doesn't look like
a huge loss, but if needed, we could add it back later and reimplement
it in terms of wxClipboard::SetData().
2023-06-20 21:00:59 +01:00
Vadim Zeitlin
a89577e8a4 Deprecate useless wxWindow::GetDefaultBorderForControl()
This function was added back in a047aff270 (Added wxBORDER_THEME,
wxWindow::GetDefaultBorderForControl(), wxWindow::CanApplyThemeBorder(),
2007-08-07) but seems to have been made completely unnecessary by
dc797d8e1b (More border rationalisation. GetDefaultBorder is now mostly
defined in base class files., 2007-11-13) soon afterwards and never did
anything other than returning wxBORDER_THEME, with no explanation as to
when it might be useful to override it not to do it.

It also doesn't seem to be really used anywhere outside wxWidgets and
has never been documented, so make it non-virtual and deprecate it to
avoid confusion and simplify things.
2023-06-16 15:55:35 +01:00
PB
81ce7edb75 Improve documentation about parallel builds with MinGW makefile
In the note about building wxWidgets with MinGW makefile and using
parallel build, explain that "-jN" option cannot be used when building
"setup_h" target.

Closes #23642.
2023-06-16 00:01:39 +02:00
Vadim Zeitlin
3d13e77b01 Merge branch 'env-wxlog-time-format'
Add support for WXLOG_TIME_FORMAT and docs improvements.

See #23576.
2023-06-02 19:07:55 +02:00
Vadim Zeitlin
674592719f Allow customizing wxLog timestamp format via environment variable
Call wxLog::SetTimestamp() with WXLOG_TIME_FORMAT value if it's defined.
2023-05-28 22:35:34 +02:00
Vadim Zeitlin
21daae3435 Improve WXTRACE documentation
Link to wxLogTrace() documentation and don't speak about "debug build"
any more.
2023-05-28 22:18:28 +02:00
Vadim Zeitlin
f2f2868de5 Add support for dark mode colours to XRC
Allow specifying a different colour to use in the dark mode in XRC
colour properties.

Closes #23571.
2023-05-27 21:51:51 +02:00
Vadim Zeitlin
20b3c887f5 Improve wxUSE_STD_IOSTREAM documentation
Clarify that it is 1 by default in the documentation, instead of
implying that it's off by default and needs to be enabled.

Improve the description of this option in setup.h files.

And also document this compilation option in the summary page.
2023-04-28 15:26:46 +02:00
Vadim Zeitlin
7824391f64 Merge branch 'use-std-containers'
Remove avoidable uses of legacy container classes by replacing them with
the standard containers.

See #23440.
2023-04-17 17:02:27 +02:00
Vadim Zeitlin
889845fbc4 Add support for wxNO_IMPLICIT_WXSTRING_CONV_TO_PTR to wxString
This symbol is similar to the existing wxNO_IMPLICIT_WXSTRING_ENCODING
and can be defined when building the application (as opposed to when
building the library) to disable implicit wxString conversions to
pointer types, i.e. char*, wchat_t* and void*.

This makes the just added wxUSE_CHAR_CONV_IN_WXSTRING library build
option unnecessary, so remove it.
2023-04-16 01:16:56 +02:00
Vadim Zeitlin
330303e078 Update wxString overview and documentation
Avoid overlap between the two pages.

Remove obsolete information.

Document wxNO_IMPLICIT_WXSTRING_ENCODING.

Don't mention wxUSE_STL any longer.
2023-04-15 20:34:24 +02:00