Commit Graph

71813 Commits

Author SHA1 Message Date
Vadim Zeitlin
20e64a53e3 Add treelist sample to the main samples bakefile
It was forgotten in samples.bkl and so wasn't built together with all
the other samples before -- do add it and rebake now.
2022-01-14 22:53:24 +01:00
Vadim Zeitlin
ee330d73a7 Rebake after the year change
The year is now included in the copyright string used in the makefiles
and so they need to be regenerated every time the year changes (which
happens surprisingly frequently).

It would be better to define a single variable with the year number to
avoid having to do this in the future.
2022-01-14 22:51:24 +01:00
bakcsizs
882a6caadb Fix <big> and <small> behaviour in wxHTML
Correctly set the font size to the size one bigger or smaller than the
current one instead of just setting it to size 1 in both cases.

Apparently this was broken ever since this code was added back in
4f9297b0ee (wxHTML src code indentation now conforms (more) to wxWin
coding style, 2000-11-05) without anybody noticing.

Closes #22012.
2022-01-14 01:28:42 +01:00
Vadim Zeitlin
1f401475f3 Merge branch 'art-scalefactor'
Fix confusion between different kinds of coordinates in wxAUI code,
restoring correct behaviour in high DPI on all platforms.

See #2620.

Closes #19331.
2022-01-13 17:51:00 +00:00
Stefan Csomor
2ed79f8f88 Also fix AUI tab size calculation in high DPI
This is similar to the parent commit and does the same thing for the
total width calculation.
2022-01-13 17:47:48 +00:00
Stefan Csomor
109a6fa5b7 Fix AUI tab size calculation for non MSW ports in high DPI
The physical size returned by wxBitmapBundle::GetPreferredSizeFor() must
be converted to logical pixels when it's used as a wxDC coordinate.

This fixes a regression introduced in 391080e77d (Use wxBitmapBundle for
AUI tab pages bitmaps, 2021-11-13).
2022-01-13 17:39:34 +00:00
Vadim Zeitlin
7c7ff3cd42 Add wxBitmap::GetDIPSize() and use it in wxBitmapBundleImplArt
This fixes the problem with wrong standard bitmaps size when using high
DPI for the main monitor with wxMSW, as GetScaledSize() used here since
31f2892200 (Avoid bitmap scaling in wxArtProvider::GetBitmapBundle(),
2021-12-17) was not the right function to use there.

Closes #19331.
2022-01-13 17:34:49 +00:00
Vadim Zeitlin
03cf1f4359 Remove wxHAS_BITMAP_SCALE_FACTOR
Now wxMSW also stores the scale factor, even if it doesn't use it in its
GetScaledXXX(), so it doesn't seem useful to have this symbol for
distinguishing the platforms with and without bitmap scale factor
support, when we can just use wxHAS_DPI_INDEPENDENT_PIXELS instead in
the only place where this was used.

And as this symbol was added quite recently, in 2c1f4c002d (Add
wxBitmap::SetScaleFactor(), 2021-10-23), we can hopefully just remove it
without breaking any existing code, if we do it right now.
2022-01-13 17:34:49 +00:00
Vadim Zeitlin
f6fbc97c7b Only return really scaled bitmap size under platforms using DIPs
wxBitmap::GetScaledXXX() functions are useful for obtaining the
coordinates in logical pixels, so they should only divide by the scaling
factor on the platforms where logical pixels are actually different from
the physical ones, i.e. those using DPI-independent pixels.

This ensures that their behaviour under MSW remains unchanged even after
a1e4dca067 (Store scale factor in wxMSW bitmaps too, 2021-12-16), which
is the correct way to avoid breaking wxAUI (and other) drawing.
2022-01-13 17:34:49 +00:00
Vadim Zeitlin
afe3d0ebae Move wxHAS_DPI_INDEPENDENT_PIXELS definition to wx/features.h
This is going to be used in wxBitmap code, where wx/window.h is not
included.
2022-01-13 17:34:49 +00:00
Vadim Zeitlin
2945278334 Rename wxHAVE_DPI_INDEPENDENT_PIXELS to wxHAS_XXX and document it
Using wxHAS_ prefix is more consistent with all the other similar
symbols, using wxHAVE_ was a mistake, that we have to pay for by
preserving the old name now (as it is actually already used in some code
outside of the library).

The fact that it's used also shows that it's better to document this
symbol, even if just to explain that it normally shouldn't be used, as
we can't really hide it anyhow.
2022-01-13 17:34:49 +00:00
Vadim Zeitlin
10977b0eb6 Don't make wxBitmap::GetScaledXXX() virtual
There should be never any need to override them, their behaviour is
fixed.

No real changes.
2022-01-13 17:34:49 +00:00
Vadim Zeitlin
bbdbee3e57 Use wxArtProvider::GetBitmapBundle() in the AUI sample
This sweeps under the carpet the regression which resulted in bitmaps
returned from wxArtProvider::GetBitmap() not looking the same since
starting to use wxBitmapBundle in AUI, but OTOH it just doesn't seem
possible to both preserve the compatibility and allow actually using
appropriate, not scaled, bitmaps in different resolutions.

The new code is as simple as the old version, follows the official
advice to use GetBitmapBundle() rather than GetBitmap(), and looks good
in high DPI, which should compensate for the behaviour change.
2022-01-13 17:34:49 +00:00
Vadim Zeitlin
f78db92462 Avoid bitmap scaling in wxArtProvider::GetBitmapBundle()
Instead of immediately constructing the bitmap with the requested size,
possibly by downscaling a higher-resolution bitmap, and then potentially
having to upscale it if we actually need a bitmap of a bigger size, just
retrieve the bitmap in the actually needed size from wxArtProvider when
needed.

This makes bitmaps obtained from wxArtProvider::GetBitmapBundle() look
good, rather than fuzzy and ugly, in high DPI if they're actually
available in the appropriate size.
2022-01-13 17:34:49 +00:00
Vadim Zeitlin
072390258c Use wxBitmapBundle for wxTreeCtrl images in the AUI sample
This sample is supposed to look good in high DPI and this requires using
wxBitmapBundle rather than wxImageList, so change it to do it.
2022-01-13 17:34:49 +00:00
Vadim Zeitlin
d12ba79ffb Remove useless SetToolBitmapSize() calls from the AUI sample
wxAuiToolBar::SetToolBitmapSize() doesn't do anything and never did ever
since it was added back in 1154f91b6a (added wxAuiToolBar, 2008-08-24),
so don't bother calling it, this just makes the sample code confusing as
no effect from passing different sizes to SetToolBitmapSize() can be
seen during run-time.
2022-01-13 17:34:49 +00:00
Vadim Zeitlin
603c45fbe9 Make sure the icon fits into the AUI pane title bar vertically
With scaled bitmaps, the preferred bitmap version might be too big for
the pane.

Perhaps it's the title bar height which is too small, but it seems to
have been hardcoded to 17 pixels since the very first version in
50acee04cd (Initial commit of wxAUI, 2006-06-06), so don't change it.
2022-01-13 17:34:49 +00:00
Vadim Zeitlin
b35ffa5e41 Use per-window DPI scale factor in wxAuiGenericTabArt
8dcedf56d7 (Add wxWindow parameter to wxAuiTabArt::SetSizingInfo(),
2021-11-13) added "wnd" argument to SetSizingInfo(), so use it instead
of always using the DPI of the main monitor.
2022-01-13 17:34:48 +00:00
Vadim Zeitlin
2f0bce2979 Replace old Trac links with GitHub ones
Also update a couple of links to SF.
2022-01-13 16:52:58 +01:00
Vadim Zeitlin
265881c79e Revert "Explain that GitHub PRs are temporarily disabled"
This reverts commit 89e5eca17d and
replaces links to wxTrac with the new ones.
2022-01-12 23:42:18 +01:00
Vadim Zeitlin
394842aa8f Merge branch 'ci-stl'
Add STL builds to GitHub CI.

See https://github.com/wxWidgets/wxWidgets/pull/2529
2022-01-11 23:50:42 +01:00
Vadim Zeitlin
89e5eca17d Explain that GitHub PRs are temporarily disabled
This will need to be reverted when the issues migration is complete, but
wxTrac link will have to be removed/replaced.
2022-01-11 19:01:29 +01:00
Serghei Amelian
16d096b7ef Add wxWebRequestEvent::GetRequest()
It is more convenient to be able to retrieve the request object (which
is needed at least for authentication) from the event than to have to
store it separately.

Closes https://github.com/wxWidgets/wxWidgets/pull/2644

Closes #19360.
2022-01-11 18:16:09 +01:00
Vadim Zeitlin
916df1a1d1 Fix recurring typo in validator parameter description
It can be used for "data checks", not "date checks" (the latter might
work for wxDatePickerCtrl, but use "data" for it too for consistency).
2022-01-11 18:08:25 +01:00
Vadim Zeitlin
a34ab31453 Merge branch 'ak_high_dpi' of https://github.com/kosh543/wxWidgets
Add wxBitmapBundle support to wxXmlResource and start adding it to XRC
handlers.

See https://github.com/wxWidgets/wxWidgets/pull/2633
2022-01-11 15:35:54 +01:00
Vadim Zeitlin
11b8276cc4 Disable container overflow detection in Mac STL ASAN CI build
This seems to result in a false positive in BitmapComboBoxTestCase with
the following stack:

ERROR: AddressSanitizer: container-overflow on address 0x00010d5331c0 at pc 0x00010743e1e8 bp 0x00016b6f8940 sp 0x00016b6f8938
WRITE of size 8 at 0x00010d5331c0 thread T0
    #0 0x10743e1e4 in wxString::ConvertedBuffer<char>::ConvertedBuffer() string.h:3598
    #1 0x10743ddbc in wxString::ConvertedBuffer<char>::ConvertedBuffer() string.h:3598
    #2 0x10743f49c in wxString::wxString(wxString const&) string.h:1157
    #3 0x1074324ac in wxString::wxString(wxString const&) string.h:1157
    #4 0x10747a4c4 in void std::__1::allocator<wxString>::construct<wxString, wxString const&>(wxString*, wxString const&) memory:916
    #5 0x10747a3f8 in void std::__1::allocator_traits<std::__1::allocator<wxString> >::construct<wxString, wxString const&, void>(std::__1::allocator<wxString>&, wxString*, wxString const&) allocator_traits.h:288
    #6 0x107479e2c in std::__1::vector<wxString, std::__1::allocator<wxString> >::__construct_at_end(unsigned long, wxString const&) vector:1063
    #7 0x107479b3c in std::__1::vector<wxString, std::__1::allocator<wxString> >::insert(std::__1::__wrap_iter<wxString const*>, unsigned long, wxString const&) vector:1889
    #8 0x10756085c in wxBaseArray<wxString, wxSortedArray_SortFunction<wxString> >::Insert(wxString, unsigned long, unsigned long) dynarray.h:181
    #9 0x108028fbc in wxVListBoxComboPopup::Insert(wxString const&, int) odcombo.cpp:539
    #10 0x108030180 in wxOwnerDrawnComboBox::DoInsertItems(wxArrayStringsAdapter const&, unsigned int, void**, wxClientDataType) odcombo.cpp:1122
    #11 0x10826d690 in wxBitmapComboBox::DoInsertItems(wxArrayStringsAdapter const&, unsigned int, void**, wxClientDataType) bmpcboxg.cpp:169
    #12 0x10485271c in wxItemContainer::InsertItems(wxArrayStringsAdapter const&, unsigned int, void**, wxClientDataType) ctrlsub.h:160
    #13 0x1048522a0 in wxItemContainer::InsertItems(wxArrayStringsAdapter const&, unsigned int) ctrlsub.h:165
    #14 0x10483c08c in wxItemContainer::Insert(wxArrayString const&, unsigned int) ctrlsub.h:247
    #15 0x10483dac8 in ItemContainerTestCase::Count() itemcontainertest.cpp:96
    #16 0x104866e04 in BitmapComboBoxTestCase::runTest() bitmapcomboboxtest.cpp:50
    ...

0x00010d5331c0 is located 64 bytes inside of 160-byte region [0x00010d533180,0x00010d533220)
allocated by thread T0 here:
    #0 0x105546714 in wrap__Znwm+0x74 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x4a714)
    #1 0x10747ae10 in void* std::__1::__libcpp_operator_new<unsigned long>(unsigned long) new:235
    #2 0x10747ad6c in std::__1::__libcpp_allocate(unsigned long, unsigned long) new:261
    #3 0x10747ace8 in std::__1::allocator<wxString>::allocate(unsigned long) memory:870
    #4 0x10747ab88 in std::__1::allocator_traits<std::__1::allocator<wxString> >::allocate(std::__1::allocator<wxString>&, unsigned long) allocator_traits.h:260
    #5 0x10747aac4 in std::__1::__split_buffer<wxString, std::__1::allocator<wxString>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<wxString>&) __split_buffer:314
    #6 0x10747a110 in std::__1::__split_buffer<wxString, std::__1::allocator<wxString>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<wxString>&) __split_buffer:313
    #7 0x107479c30 in std::__1::vector<wxString, std::__1::allocator<wxString> >::insert(std::__1::__wrap_iter<wxString const*>, unsigned long, wxString const&) vector:1904
    #8 0x10756085c in wxBaseArray<wxString, wxSortedArray_SortFunction<wxString> >::Insert(wxString, unsigned long, unsigned long) dynarray.h:181
    #9 0x108028fbc in wxVListBoxComboPopup::Insert(wxString const&, int) odcombo.cpp:539
    #10 0x108030180 in wxOwnerDrawnComboBox::DoInsertItems(wxArrayStringsAdapter const&, unsigned int, void**, wxClientDataType) odcombo.cpp:1122
    #11 0x10826d690 in wxBitmapComboBox::DoInsertItems(wxArrayStringsAdapter const&, unsigned int, void**, wxClientDataType) bmpcboxg.cpp:169
    #12 0x1075590bc in wxItemContainer::DoAppendItems(wxArrayStringsAdapter const&, void**, wxClientDataType) ctrlsub.h:352
    #13 0x10484c9e0 in wxItemContainer::AppendItems(wxArrayStringsAdapter const&, void**, wxClientDataType) ctrlsub.h:117
    #14 0x10484c8d4 in wxItemContainer::AppendItems(wxArrayStringsAdapter const&) ctrlsub.h:122
    #15 0x10483999c in wxItemContainer::Append(wxArrayString const&) ctrlsub.h:209
    #16 0x10483ccfc in ItemContainerTestCase::Count() itemcontainertest.cpp:82
    #17 0x104866e04 in BitmapComboBoxTestCase::runTest() bitmapcomboboxtest.cpp:50
    ...
2022-01-11 15:33:16 +01:00
Lauri Nurmi
783df59e66 Fix too dark day number colors with dark themes in wxCalendarCtrl
wxBLACK was used for some day numbers, and with a dark theme the numbers
are drawn on a nearly black background, making them barely visible.

Instead, use wxBLACK explicitly for week numbers, but get the proper
color for day numbers always (and not just sometimes) with
GetForegroundColour().

Closes https://github.com/wxWidgets/wxWidgets/pull/2643
2022-01-11 15:19:19 +01:00
Alexander Koshelev
3907657995 XRC: ability to create wxToolBar with wxBitmapBundle 2022-01-11 17:05:14 +03:00
Alexander Koshelev
4b3233e493 XRC: ability to create wxCommandLinkButton with wxBitmapBundle 2022-01-11 17:05:14 +03:00
Alexander Koshelev
7a13979f5a XRC: ability to create wxButton with wxBitmapBundle 2022-01-11 17:05:14 +03:00
Alexander Koshelev
96f5258df5 XRC: ability to create wxStaticBitmap with wxBitmapBundle 2022-01-11 17:05:14 +03:00
Alexander Koshelev
612c37f706 XRC: add GetBitmapBundle function
The function creates wxBitmapBundle from <bitmaps> xrc tag.

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
2022-01-11 17:04:27 +03:00
Vadim Zeitlin
8a006eb735 Merge branch 'msw-frozen-show-events'
Fix sending wxEVT_SHOW for frozen windows in wxMSW.

See https://trac.wxwidgets.org/ticket/19216
2022-01-11 14:55:53 +01:00
AliKet
e9bb4e80cb Fix wxStaticBox repainting in RTL layout under MSW
Calculate the clipping region correctly when repainting a wxStaticBox
containing windows that are its siblings (rather than children) when RTL
layout is used: the old AdjustRectForRtl() implementation didn't mirror
the child coordinates correctly.

See #19086.
2022-01-11 02:50:37 +01:00
Vadim Zeitlin
b8f69d2167 Enable test for wxEVT_SHOW for non-MSW platforms too
This test does pass with wxGTK, so run it there.
2022-01-11 02:36:46 +01:00
Vadim Zeitlin
b4ff385039 Revert addition of MSW-only test for notebook pages wxEVT_SHOW
This doesn't work in wxGTK and it doesn't seem useful to have a MSW-only
test for this, finally.
2022-01-11 02:10:36 +01:00
PB
2cb37faa9a Define NANOSVG_ALL_COLOR_KEYWORDS before including NanoSVG
When NANOSVG_ALL_COLOR_KEYWORDS is not defined, only 10
of the 147 SVG named colors are recognized and all the
others are displayed as black.
2022-01-09 17:10:59 +01:00
Dummy
006fd1a511 Fix sending show events when hiding frozen windows in wxMSW
Send these events ourselves because MSW itself doesn't generate them for
frozen windows. This makes wxMSW more consistent with the other ports.

Add unit tests to verify that the behaviour is really as expected for
both normal and frozen windows, at least under MSW -- under GTK these
events are not sent at all for the notebook pages.

Closes #19216.
2022-01-08 22:14:04 +01:00
Vadim Zeitlin
7f5fe09a34 Merge branch 'mac-dvc-freeze'
Optimize column adjustments when wxDVC is frozen under Mac.

See https://github.com/wxWidgets/wxWidgets/pull/2614
2022-01-08 19:59:02 +01:00
Vadim Zeitlin
666c9dbbd8 Restore correct return value of cancelled drag in wxMSW
Fix regression originally introduced in f5548e399e (Fix problem with
dragged icon remaining on screen under MSW 10, 2020-01-11) and changed,
but not fixed, in b6c593af45 (Fix regression in MSW DoDragDrop() return
code, 2020-05-03) by restoring the original code from before these
changes except for moving the cleanup logic in a local object dtor.

Closes #19274.
2022-01-08 19:15:33 +01:00
Paul Cornett
ef779835b4 Document when GetItemParent() was added 2022-01-07 22:00:00 -08:00
Paul Cornett
3cd791de21 Add GetItemParent() to wxDataViewTreeCtrl
Makes it a little easier to convert from using wxTreeCtrl to wxDataViewTreeCtrl
2022-01-07 14:48:36 -08:00
Vadim Zeitlin
27d5306bdd Make wxToolBar::SetToolBitmapSize() work again
It didn't do anything since wxBitmapBundle-related changes, as could be
seen by toggling the bitmap size in the toolbar sample -- the bitmaps
size didn't actually change.

Make it work again by only using the best bitmap size if it's greater
than the currently set bitmap size, but not shrinking the bitmaps to it
if it's smaller. This doesn't seem especially useful, but this is how
the code behaved with single bitmaps before and there doesn't seem to be
any good reason to change this.

At least document that calling SetToolBitmapSize() is unnecessary and
normally shouldn't be done.
2022-01-07 00:13:52 +01:00
Vadim Zeitlin
af641ba7b8 Merge branch 'skip-dpichange-events'
Fix wxGenericColourButton after recent bitmap changes and, more
generally, always skip wxDPIChangedEvent and document that this should
be done.

See https://github.com/wxWidgets/wxWidgets/pull/2637
2022-01-06 23:46:35 +01:00
Vadim Zeitlin
f5e0076f04 Advise to skip wxDPIChangedEvent when handling them in the manual
Not skipping them is almost invariably a bug, as shown by the
grandparent commit.
2022-01-06 23:45:28 +01:00
Maarten Bent
2cae38502f Fix wxGenericColourButton bitmaps for different button states
Only the bitmap of the normal state was updated, not of the other (focused, hover, disabled, etc) states.
This became obvious after ee93f4cae8, but already happened before that for the disabled state.

Invalidate the bitmapButton using wxNullBitmap, so all states will be updated when setting the bitmap.
2022-01-05 23:20:42 +01:00
Maarten Bent
e2d34e982e Skip all wxDPIChangedEvent
So base classes will process the event too.
This is need for (at least) wxGenericColourButton It has its own handler,
but also needs to handle the DPI event in wxButtonImageData.
2022-01-05 22:47:32 +01:00
Vadim Zeitlin
31279195f4 Fix building tests with MSVS 2022 in C++20 mode with /permissive-
Update Catch submodule to include the fix for std::uncaught_exception()
not being available with these compiler options.

Closes #19355.
2022-01-04 23:13:39 +01:00
Tobias Taschner
a5cec42bb6 macOS: Use public API for fullscreen in wxWebView
To enable fullscreen support with WKWebView private API which was
available since macOS 10.11 was used. Beginning with macOS 12.1 this
resulted in unpredictable layout issues inside the webview.

This reimplementation using java script and message handlers does only
use public API. This also makes the fullscreen message more controlable
as the webview does no longer put the containing window in fullscreen
mode without application code intervention. That also unifies macOS with
the way Edge sends this event in MSW.

Closes https://github.com/wxWidgets/wxWidgets/pull/2629
2022-01-04 22:54:39 +01:00
Vadim Zeitlin
c864c9119b Document wxIMPLEMENT_{APP,WXWIN_MAIN}_CONSOLE macros too
Even though they're less useful than their non-CONSOLE counterparts,
they still should be documented.

Closes #19358.
2022-01-04 22:51:06 +01:00