Commit graph

73807 commits

Author SHA1 Message Date
Maarten Bent
431171c2d0
Enable wxWebViewEdge in MSW Clang CI 2022-12-23 21:55:24 +01:00
Maarten Bent
1ace6a6aad
Resolve some Clang warnings on Windows 2022-12-23 21:53:47 +01:00
Vadim Zeitlin
82eb445722 Merge branch 'webview_BrowserAcceleratorKeys' of https://github.com/TcT2k/wxWidgets into master
Add wxWebView::EnableBrowserAcceleratorKeys().

See #23070.
2022-12-23 20:08:16 +01:00
Stefan Ziegler
00f89c69de Fix retrieving printer information in wxMSW print dialog code
This didn't work because the result of the first call to GetPrinter(),
done only to retrieve the buffer size, doesn't matter and should _not_
be checked as otherwise we're never going to succeed retrieving anything
at all.

Closes #23068.
2022-12-23 20:08:00 +01:00
Vadim Zeitlin
bfaff8767d Merge branch 'webviewedge-fixes' of https://github.com/PBfordev/wxWidgets into master
Fix building wxWebViewEdge with MinGW.

See #23067.
2022-12-23 20:08:00 +01:00
Maarten Bent
ddea807a2a Simplify defining manifest in wx.rc
Avoid complicated preprocessor manipulations not needed any more since
the simplifications of 10d2354125 (Merge branch
'simplify-application-manifests', 2021-12-18).

Fixes #23057.

Closes #23065.
2022-12-23 20:08:00 +01:00
ali kettab
16da1a1ece wxListBox and wxRearrange{List,Ctrl,Dialog} fixes for wxQt
Implement wxListBox functions related to layout and hit testing.

Fix wxRearrange{List,Ctrl,Dialog} that were previously totally broken
under wxQt.

This also makes RearrangeListTestCase test pass.

Closes #23063.
2022-12-23 20:08:00 +01:00
Vadim Zeitlin
ff7fc88c01 Merge branch 'tiff-fixes' into master
Fix writing out corrupted TIFF files due to misusing TIFFSetField().

See #23056.
2022-12-23 20:07:55 +01:00
Vadim Zeitlin
795190ffbe Merge branch 'log-enable-mt-safe' into master
Minor improvements to logging MT-safety.

See #23054.
2022-12-23 20:07:50 +01:00
PB
e67532085b Improve wxWidgets naming conventions docs
Fix swapped names for static and shared build folder on Windows
in "type" description.

Also provide more details in some paragraphs.

Closes #23053.
2022-12-23 20:07:50 +01:00
Khem Raj
1faf1796b2 Fix wxUILocale compilation with musl
Avoid using glibc specific defines when using musl, which does not
provide glibc-only enum members such as _NL_ADDRESS_LANG_NAME.

Signed-off-by: Khem Raj <raj.khem@gmail.com>

Closes #23050.
2022-12-23 20:07:50 +01:00
Vadim Zeitlin
1dfab1b63a Merge branch 'treelist-sort' into master
Fix for wxTreeListCtrl and wxDataViewCtrl sorting.

See #23045.
2022-12-23 20:07:45 +01:00
Vadim Zeitlin
7899850496 Do use host-specific pkg-config when cross-compiling
This re-enables the use of $host-pkg-config after it was disabled again
by d6ddfe87e1 (Disable build system pkg-config when cross-compiling to
non-Linux, 2022-11-30).

Closes #23037.
2022-12-23 19:24:30 +01:00
Tobias Taschner
78d8e2e9c2
Update include/wx/msw/private/webview_edge.h
Co-authored-by: Maarten <MaartenBent@users.noreply.github.com>
2022-12-23 15:02:18 +01:00
Tobias Taschner
db9419af4b
Add wxWebView::EnableBrowserAcceleratorKeys()
The edge backend has various accelerator keys enable per default.
This include Ctrl-P, Ctrl-F, F5 and others. In many uses of webview
this might not be desirable and can be disabled.

This is currently only implemented for the Edge backend.

Raises required WebView2 SDK version from 1.0.705.50 to 1.0.864.35
2022-12-23 14:12:36 +01:00
PB
4e54c65264 Fix compiler warnings in wxWebViewEdge code
Initialize member variables in the order they were declared,
use "using" to prevent hiding base class overload, and
add a missing "override" specifier.
2022-12-22 21:34:29 +01:00
PB
08f18292ce Add GUID declaration for ICoreWebView2WebResourceRequestedEventHandler
MinGW does not provide GUID declarations for webview2 COM interfaces,
we must provide them all ourselves.
2022-12-22 21:24:36 +01:00
Artur Wieczorek
cf661f9293 Specify what is the limit set by wxPGProperty::SetMaxLength()
It needs to be stated clearly that the limit applies only to the text
the user can enter in the editor associated with property.
This constraint does not apply to the length of text represenations
of values set programmatically.
Corresponding test were added.
2022-12-22 20:53:44 +01:00
Artur Wieczorek
f1bb6080a2 Store wxPGProperties to be deleted in std::set instead of std::vector
Pointers to wxPGProperties to be deleted/removed are unique
in the collection so they should be stored in std::set.
2022-12-22 20:53:03 +01:00
Artur Wieczorek
014df70c1f Store indexes of columns in std::set instead of std::vector
Indexes of colums are unique in the collection so they should be
stored in std::set.
2022-12-22 20:52:30 +01:00
Artur Wieczorek
41a390317c Enable wxPaintDC test under wxGTK3
Test should pass now.
2022-12-22 18:42:57 +01:00
Artur Wieczorek
e7a2786352 Remove duplicated method to destroy clipping region in wxPaintDCImpl (wxGTK)
Destroying clipping region is since 106b850593
("Fix wxCairoContext::ResetClip() for wxGTK", 2022-10-28) fully handled in
parent wxGCDCImpl::DestroyClippingRegion() calling wxCairoContext::ResetClip()
(including re-establishing clip for paint update area) so there is no need
to implement overriding method in wxPaintDCImpl.

Closes #23046.
2022-12-22 18:42:57 +01:00
Vadim Zeitlin
c9efe22763 Improve TIFF saving test code
Give more details in case of failure by using INFO() and use simple
CHECK()s instead of ugly WX_ASSERT_EQUAL_MESSAGE as they will show the
failing test anyhow.

No real changes.
2022-12-20 00:23:45 +01:00
Vadim Zeitlin
943e1c3e7e Skip useless seeks when writing TIFF files
Just a micro-optimization: don't do anything if we're asked to seek 0
bytes from the end of the stream, as this is always our current position
anyhow.
2022-12-20 00:23:45 +01:00
Vadim Zeitlin
af923360ab Fix type of values passed to TIFFSetField()
This vararg function accepts any kind of values, without any checks, but
actually needs double for TIFFTAG_[XY]RESOLUTION and not int that we
passed to it, and which could result in the double values actually
having a NaN value of the word on the stack before the int happened to
have just the wrong value and which, in turn, resulted in a failure to
save the TIFF file later as libtiff checks that the values are valid,
i.e. positive and not-NaN. Note that we really need to pass the values
as doubles, even if they're stored as floats internally and returned as
such by TIFFGetField().

Also fix the types for all the other calls of this function, even if
this hasn't been observed to result in any problems so far.

Closes #23048.
2022-12-20 00:23:34 +01:00
Vadim Zeitlin
08104d819e Merge branch 'ci-msw-cross-improve'
Enable optimizations in MSW CI cross-builds to avoid a mysterious test
failure in the non-optimized build with MinGW gcc 12.

See #23049.
2022-12-19 02:26:11 +01:00
Vadim Zeitlin
2ed4e6bee4 Improve wxImage::ChangeColours test code
Use a helper function to both make it shorter and provide more
information in case of a check failure: now the output will include the
name of the file, comparing with which failed, allowing to immediately
see which test failed.
2022-12-19 01:19:06 +01:00
Vadim Zeitlin
f77390551f Relax checks for image equality in wxImage::ChangeColours
Allow difference of 1 as this is what we get when using -O2 with gcc 12.
2022-12-19 01:11:39 +01:00
Vadim Zeitlin
5bc7ffd8c7 Suppress -Wnonnull warning in the except sample
We really want to crash here, so disable the helpful warning that tries
to prevent us from doing it.
2022-12-18 23:21:19 +01:00
Vadim Zeitlin
828a5b2c52 Show compiler version in the MSW cross-builds CI workflow
This avoids the need to go hunting for the version of the package
installed by apt-get.
2022-12-18 22:43:48 +01:00
Vadim Zeitlin
f2c04694e1 Enable optimizations in cross MSW CI builds
Amazingly, it seems that the latest gcc 12-based MinGW miscompiles
something in TIFF code _without_ optimizations as the SaveTIFF() test
fails when compiled with -O0 but works with -O2, so try enabling the
optimizations for this test.

It also makes more sense to run tests against the production/release
versions of the library anyhow, we only used --disable-optimise to save
on build time, but perhaps this is not as critical any longer.
2022-12-18 22:41:04 +01:00
Vadim Zeitlin
c7255734dd Use wxLogNull to temporarily disable logging in wxZipInputStream
Using this class is simpler, more efficient and MT-safe, which is
important because wxZipInputStream can be used from a background thread
(e.g. to decompress a file downloaded from the network etc).
2022-12-18 21:42:00 +01:00
Vadim Zeitlin
2c937f4ae7 Annotate some MT-safe and unsafe wxLog functions
Document that wxLog::SetLogLevel() is not MT-safe and that wxLogNull
should be used instead of calling it to temporarily change the log level
from the other threads.
2022-12-18 21:41:05 +01:00
Artur Wieczorek
6ba55b96b8 Skip all wxPaintDC tests for clipping on wxOSX
All test are known to fail because there is a problem with effectively
repainting a window in the testing environment.
2022-12-18 17:18:03 +01:00
Artur Wieczorek
e09bf951b9 Skip test known to fail on wxGTK3 2022-12-18 17:18:03 +01:00
Artur Wieczorek
9af0f9f463 Replace wxClientDC tests with wxPaintDC ones 2022-12-18 17:18:03 +01:00
Vadim Zeitlin
612dfa447a Log image information earlier in the image unit test
Use INFO() before some checks that may already fail to at least show in
which test the failures occur.
2022-12-18 03:30:44 +01:00
Vadim Zeitlin
4d33ddcacf Resort wxTreeListCtrl in its SetSortColumn()
wxDataViewCtrl doesn't resort itself automatically when
wxDataViewColumn::SetSortOrder() is called and changing this might not
be necessarily a good idea, so just resort it explicitly in
wxTreeListCtrl itself -- because it should definitely be updated when
SetSortOrder() is called, as there is no way to do it using its API
otherwise.

Closes #22852.
2022-12-18 02:57:59 +01:00
Vadim Zeitlin
c662f12150 Reset old sort indicator in GTK wxDataViewColumn::SetSortOrder()
It doesn't make sense to show sort indicator for more than one column in
the current GTK wxDataViewCtrl implementation because it always uses
exactly one column for the actual sorting, but this is exactly what
happened if SetSortOrder() was called on a column different from the
currently used one.

Explicitly reset the sort indicator shown for the old sort column to
prevent this from happening.
2022-12-18 02:57:58 +01:00
Vadim Zeitlin
c0576b28d3 Sort only by this column in wxDataViewColumn::SetSortOrder()
Make the generic version behave consistently with the native ones and
replace any existing sort columns with the current one unless multi
column sort is allowed (which is not the case by default and not
supported by the native versions).

This ensures that calling SetSortOrder() from the program now has the
same effect as clicking on the column header interactively.

This change is not backwards-compatible but can be arguably considered
as a bug fix, as it doesn't seem like the old behaviour, which showed
only one sort column in the UI, but sorted using multiple columns
internally, could be ever useful.
2022-12-18 02:34:20 +01:00
Ian McInerney
a8ea3eda11 Allow selecting and copying text in wxMessageDialog on GTK
Normally the GTK message dialogs have non-selectable text, but that also
means users can't copy the text. This can be inconvenient if the dialog
is used for error messages, since then the error message can't be
copied.

Instead, make the text labels used in the GTK message dialog selectable
to fix that.

Closes #23039.
2022-12-18 02:22:26 +01:00
Vadim Zeitlin
5a23fd7a6e Fix scaling of standard MSW platform icons in high DPI
Use the correct scaling factor when creating the bitmap in
wxWindowsArtProvider, otherwise the bitmap was wrongly rescaled again
when actually using it.

It still seems wrong to always use the primary display scaling here, but
we just don't have any window to use in this code and at least it is
consistent and works when primary display scaling is not 100% now.

Closes #23031.

Closes #23038..
2022-12-18 02:16:07 +01:00
Vadim Zeitlin
a86d48babf Merge branch 'tlw-unique-child-best-size'
Improve wxTLW::GetBestSize() for windows with the unique child.

See #23035.
2022-12-18 02:14:26 +01:00
Gerhard Gruber
c6ef438c10 Fix wxNotebook::HitTest() for horizontal orientation in wxMSW
Native control doesn't seem to implement TCM_HITTEST correctly for the
tabs on the left or right side, so provide our own implementation of
HitTest() in this case.

Also add a unit test checking that HitTest() does something reasonable.

Closes #4775.

Closes #23023.
2022-12-18 02:12:23 +01:00
Vadim Zeitlin
92a076b12b Avoid -Wunused-result in the except sample
MinGW gcc 12 started giving this (useful) warning in STL build because
its std::vector::operator[] is declared with nodiscard attribute, but we
really don't want to use the result here, so suppress it.
2022-12-18 02:10:12 +01:00
Vadim Zeitlin
b47c46a8d7 Merge branch 'qt-listctrl-fixes' of https://github.com/AliKet/wxWidgets
wxListCtrl fixes for wxQt.

See #23029.
2022-12-15 01:26:37 +01:00
Vadim Zeitlin
bcb9c19358 Improve GetBestSize() for TLWs containing a single child
Previously the best size of such TLW was determined by the current size
of its only child, which is the behaviour inherited from wxWindow, where
it makes sense, as it works for the manually positioned children.

However at TLW level, the only child is not positioned manually but is
resized to the available client size by default, which means that this
logic didn't make much sense, as the best size grew whenever the TLW was
made larger but never shrunk.

Fix this by returning the best size of the unique child, if we have one,
as this seems much more logical: now the TLW best size is just big
enough for its contents, just as it should be.

In particular, this avoids making such TLWs bigger on each change from
higher to lower DPI in wxMSW, where the code ensures that the window is
still big enough to fit its contents at the new DPI.

Closes #22983.
2022-12-14 14:58:12 +01:00
Vadim Zeitlin
32caf7cbab Factor out wxTopLevelWindowBase::Layout() helper functions
Create GetUniqueChild() and UsesAutoLayout() functions by extracting
them from Layout(), as they are going to be reused elsewhere.

No real changes yet, even though the check for the child being shown has
been slightly changed, it still does the same thing as before.

This commit is best viewed with Git --color-moved
--color-moved-ws=ignore-all-space -w options.
2022-12-14 14:55:15 +01:00
ali kettab
f7efe297f3 wxQt: added wxEVT_LIST_KEY_DOWN event generation to wxListCtrl 2022-12-14 14:36:29 +01:00
ali kettab
fccdce2e20 wxQt: fix crash when asterisk key (Qt::Key_Asterisk) is pressed
The crash happens inside QTreeView::keyPressEvent(QKeyEvent*) when handling
Qt::Key_Asterisk key press. The reason is the non conformant rowCount() and
columnCount() implementations which according to Qt documentation should
return 0 when the parent is valid.
2022-12-14 14:21:41 +01:00