Commit graph

21008 commits

Author SHA1 Message Date
Vadim Zeitlin
a942fb1774 Merge remote-tracking branch 'MaartenBent/chromium' into webview-chromium
Fix CMake support.
2023-12-28 18:57:07 +01:00
Vadim Zeitlin
4f1a249b76 Call CefDoMessageLoopWork() even more aggressively
Calling this function from OnInternalIdle() is not always enough, so
call it before processing each and every event to ensure that CEF can
really do whatever it needs to be doing internally.

This doesn't seem to noticeably slow down the program and solves weird
problems, like embedded text boxes (e.g. search zones on the web sites)
not getting focus on click.
2023-12-22 02:20:49 +01:00
Maarten Bent
62c6533fa7
CMake: Update webview related checks 2023-12-21 21:26:41 +01:00
Vadim Zeitlin
6f130c121f Add wxWebViewChromium::SetRoot()
This allows to define a prefix for all the files used by the application
in the browser.
2023-12-20 01:39:02 +01:00
Vadim Zeitlin
e90817930a Merge branch 'master' into webview-chromium 2023-11-30 18:30:26 +01:00
Vadim Zeitlin
7e2b0eea19 Merge branch 'args-init-improve'
Minor improvements to command line arguments initialization.

See #24103.
2023-11-30 02:53:44 +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
Stefan Csomor
bcbc31e97f Fix clipping of scrolled windows under macOS Sonoma
We need to use a native clip view for things to behave correctly under
this OS version, otherwise scrollbars can be overdrawn by the window
contents.

Closes #24067.

Closes #24073.
2023-11-30 02:16:04 +01:00
Vadim Zeitlin
d4484c48c4 Rename wxInitData::InitializeFromWide() to InitIfNecessary()
And do nothing in this function if the arguments had been already
initialized, as it will make it more convenient to call from other
places.

No real changes.
2023-11-30 00:41:09 +01:00
Vadim Zeitlin
e30309bf8c Replace wxEVT_IDLE handler with overridden OnInternalIdle()
This function is always called, even if the application prevents the
wxEVT_IDLE handler from being called, either by forgetting to Skip() the
event in its own handler of this message or by changing the global idle
event generation mode to wxIDLE_PROCESS_SPECIFIED.
2023-11-29 01:47:29 +01:00
Vadim Zeitlin
8d4ca2b191 Extract wxIdleEvent handler into its own function
No real changes yet, just make the lambda a member function before
adding more code to it.
2023-11-29 01:47:29 +01:00
Vadim Zeitlin
fada5fa044 Make wxWebViewChromium::OnSize() private
Also make a couple of cosmetic/style fixes.

No real changes, just don't leave the event handler public when it
doesn't have to be.
2023-11-29 01:47:29 +01:00
Tim Eliseo
fce4941404 Add wxHAS_PREMULTIPLIED_ALPHA to abstract if wxBitmap pixels are premultiplied.
All previous relevant platform-specific tests have been changed to use this
symbol. Also, samples/image now premultiplies conditionally, correcting a
visual anomaly on wxGTK.
2023-11-26 13:23:52 -08:00
Paul Cornett
4030f3b90c Remove extraneous semicolons 2023-11-23 09:25:03 -08:00
Vadim Zeitlin
dede4b9326 Use "= default" for all trivial default ctors and dtors
Replace user-specified empty constructors and destructors with the
compiler-generated versions, which has a number of advantages for code
generation, in addition to being more clear.

Closes #22965.

Closes #24058.
2023-11-17 01:33:32 +01:00
Vadim Zeitlin
7a73044fd2 Merge branch 'tree-search'
Don't find hidden items when using incremental tree search.

See #24041.
2023-11-17 01:08:19 +01:00
Vadim Zeitlin
ba9fe3481d Merge branch 'gtk-dpi-changed'
Generate DPI changed event in wxGTK too.

See #24040.
2023-11-17 01:06:54 +01:00
Vadim Zeitlin
5a184d423b Merge branch 'qt-uiaction-tests' of https://github.com/AliKet/wxWidgets
Enable automatic tests using wxUIActionSimulator under wxQt.

See #24015.
2023-11-17 01:05:56 +01: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
8ca1be38e2 Add wxGenericTreeCtrl::DoGetNext(Next_Visible) function
This is similar but not totally identical to the existing
GetNextVisible() as it doesn't require the initial item itself to be
visible (notably, it could be the hidden virtual root).

It is also more efficient than the old GetNextVisible() implementation
calling GetNext() in the loop until finding a visible item, as it avoids
looking inside collapsed items in the first place.
2023-11-08 01:52:00 +01:00
Vadim Zeitlin
88a39aa6f8 Implement wxEVT_DPI_CHANGED generation for wxGTK
Just check if the scale factor has changed when getting a "configure"
event for a TLW as we're guaranteed to get one when the scale factor
does change, according to GTK documentation (and it does seem to work).

Closes #19290.
2023-11-07 20:57:31 +01:00
Vadim Zeitlin
7aef620715 Fix using bitmaps of different dimensions in wxWithImages
Although this is not ideal, it may still happen and sometimes can even
give acceptable results, e.g. using (16, 32) and (24) bitmap bundles
can actuall works nicely enough at x2 scaling if 16px bitmaps are
upscaled by the factor of 3.

To make this work, request the explicit physical bitmap size and
override its scale factor to ensure the resulting bitmap has the correct
logical size.
2023-11-07 00:47:07 +01:00
Vadim Zeitlin
baa56732fc Allow to get the size of all images in wxWithImages
This simplifies wxGenericTreeCtrl code but doesn't change much yet.
2023-11-07 00:26:53 +01:00
Vadim Zeitlin
6080dca576 Add wxWindow::WXNotifyDPIChange() for wxOSX and wxGTK
This refactors the already existing code in wxOSX to make it available
in the common class and allow reusing it in wxGTK.

No changes yet.
2023-11-06 23:51:30 +01:00
Vadim Zeitlin
e679e5d4c2 Replace Mac-only function with wxWindow::MakeDPIFromScaleFactor()
The new function does the same thing as the Mac-specific
OSXMakeDPIFromScaleFactor() that it replaces but is also defined in
wxGTK where it will be used too.
2023-11-06 23:51:28 +01:00
Vadim Zeitlin
089bf467a9 Allow passing const wxWindow* to more wxBitmapBundle methods
Take const pointer in GetConsensusSizeFor(), which only uses this
parameter to get the DPI scale factor, and CreateImageList(), using it
only to pass it on to GetConsensusSizeFor().

No real changes.
2023-11-06 22:05:25 +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
a0f7980295 Add wxAuiTabCtrl::DoEndDragging()
No real changes, just refactor the code to reset all drag-related
variables in a single function instead of doing it manually in several
places.

As this function also resets m_clickTab, which could previosuly remain a
dangling pointer, change the code to get its value before calling it.
2023-11-06 00:11:52 +01:00
Vadim Zeitlin
0fd15e405f Initialize wxAuiTabCtrl members in their declarations
Ensure that all of them are initialized, including m_clickTab, which
didn't seem to be always initialized before.

No real changes (as m_clickTab doesn't seem to have been used before it
was initialized).
2023-11-06 00:05:50 +01:00
Vadim Zeitlin
0d4792cc2d Refactor wxImageList classes to use wxImageListBase
This ensures that the native MSW and generic implementations provide the
same API by forcing them to implement the same pure virtual functions.
2023-11-03 01:53:36 +01:00
Vadim Zeitlin
3f971f52c1 Add using declaration for ctors to generic wxImageList
Instead of explicitly forwarding the ctors to the base class manually,
just use them.
2023-11-03 01:38:59 +01:00
Vadim Zeitlin
0003ac6873 Replace wxImageList::Init() with member initializers in wxMSW
No real change, just initialize members in their declarations and get
rid of now unnecessary Init().
2023-11-03 01:36:00 +01:00
Vadim Zeitlin
260a109db6 Remove outdated comment about making wxImageList ref counting
This hasn't happened since 26 years, so don't pretend it's going to
happen now that this class is semi-deprecated.
2023-11-03 01:27:57 +01:00
Vadim Zeitlin
f9a22962e0 Add wxTreeCtrl::GetStateImageCount() and HasStateImages()
Add these functions for consistency with SetStateImages() and to avoid
using GetStateImageList() in the treectrl sample, which can now use
GetStateImageCount() instead.
2023-11-03 00:53:40 +01:00
Vadim Zeitlin
308e902102 Add wxTreeCtrl::SetStateImages()
Unlike the existing SetStateImageList() function, the new one allows to
provide the high-resolution versions of the state images too.

Update the treectrl sample to use the new API.

Closes #23993.
2023-11-03 00:53:40 +01:00
Vadim Zeitlin
6021f44e6a Fix clearing images used with wxWithImages
Doing this must reset any existing image list, as some controls (notably
wxTreeCtrl) use the image list internally and keeping using it would
still show the old images even after resetting them.
2023-11-03 00:53:39 +01:00
ali kettab
4652bb05f8 Added missing wxEVT_TREE_KEY_DOWN event generation under wxQt 2023-10-31 20:53:56 +01:00
Vadim Zeitlin
600049f20c Merge branch 'dfb-cxx17'
Fix wxDirectFB build with C++17.

See #23991.
2023-10-25 23:49:00 +02:00
Vadim Zeitlin
9e8a913e4d Merge branch 'qt-textctrl-hittest' of https://github.com/AliKet/wxWidgets
Implement several previously missing wxTextCtrl functions in wxQt.

See #23984.
2023-10-25 23:46:30 +02:00
Vadim Zeitlin
9d06e4c4a7 Implement wxSearchCtrl::GetEditHWND() correctly in wxMSW
Since the changes of 4d76a87015 (Make wxSearchCtrl inherit from
wxTextEntry in all ports, 2023-07-09, see #23697) GetEditHWND() returned
null for wxSearchCtrl which was considered to be correct because all
wxTextEntry functions were supposed to be forwarded to wxSearchTextCtrl
anyhow.

This wasn't really correct, however, as GetEditHWND() was also called
from SetHint(), resulting in an assert failure and falling back on
generic hint implementation which, while mostly working, suffers from
some problems that the native implementation doesn't have.

So make this function return the actual HWND used by the associated text
entry to fix this and allow SetHint() to work as before and also
forestall any problems due to not having the right HWND in the future.

See #23983.

Closes #23975.
2023-10-25 23:45:23 +02:00
Vadim Zeitlin
b389483c58 Work around the use of "register" in DirectDB headers
This keyword results in deprecation warnings since C++11 and errors
since C++17 in which it was completely removed.
2023-10-24 01:21:39 +02:00
ali kettab
d91fd33ffd Implement wxTextCtrl::{Set,Is}Editable() under wxQt 2023-10-22 19:57:48 +01:00
ali kettab
334814bf85 Implement wxTextCtrl::SetMaxLength() function under wxQt
This is currently implemented for single line control only. But unfortunately the
wxEVT_TEXT_MAXLEN event is only emitted when the Qt version used is 5.12 or higher.
2023-10-22 18:54:23 +01:00
ali kettab
9b2e4ff2e5 Implement wxTextCtrl::HitTest() function under wxQt 2023-10-22 18:05:13 +01:00
ali kettab
6d7f9342be Fix wxContextMenuEvent event propagation under wxQt
Closes #23973.
2023-10-22 01:32:58 +02:00
Vadim Zeitlin
e43f913313 Remove all blank "Modified by:" lines from top comment blocks
Having this line is not useful at all as it doesn't contain any
information and shouldn't be filled in the future as git-shortlog can
provide the information about people who changed the given file more
more reliably than consulting the comments in any case.

Keep the non-blank lines for historical purposes.
2023-10-22 01:22:48 +02:00
Vadim Zeitlin
c601bf4279 Merge branch 'qt-fixes'
Fix bugs preventing GUI tests from working with wxQt and provide native
implementations of wx{Date,Time}Ctrl in this port.

See #23925.
2023-10-22 01:18:50 +02:00
Vadim Zeitlin
e478aa74b1 Use "= default" for default ctors of just added classes
Also remove a couple of unneeded lines.
2023-10-22 01:18:26 +02:00
ali kettab
032fc66cea Now wxTimePickerCtrl is a native control under wxQt 2023-10-15 13:35:24 +01:00
ali kettab
e20d8ba2cc Now wxDatePickerCtrl is a native control under wxQt 2023-10-15 13:35:24 +01:00