Commit graph

76005 commits

Author SHA1 Message Date
Vadim Zeitlin
aa14096ca9 Use unique_ptr instead of manual memory management
No real changes, just use unique_ptr<wxClientDC> instead of deleting the
DC object manually.
2023-12-26 19:27:50 +01:00
Vadim Zeitlin
f82047feaf Make wxAuiManager::Repaint() logic a bit more clear
No real changes, just write a single check for "dc == nullptr" instead
of doing it twice in combination with preprocessor checks.

This commit is best viewed with Git --color-moved option.
2023-12-26 16:41:08 +01:00
Vadim Zeitlin
62d652c353 Use wxUSE_AUI_LIVE_RESIZE_ALWAYS instead of explicit port checks
This allows to avoid repeating the checks for the ports in which
wxClientDC can't be used in multiple places.

No real changes.
2023-12-26 16:31:24 +01:00
ali kettab
69ec562f16 Update outdated comments under wxQt
There is no longer a QtGetContainer() function name. wxQtEventForwarder was renamed
to wxQtEventSignalHandler. And QtGetScrollBarContainer() was just removed in previous
commits.
2023-12-26 12:45:52 +01:00
ali kettab
840d362a70 Keep forward declarations of Qt classes in alphabetical order 2023-12-26 12:45:52 +01:00
ali kettab
15f3f4c3af Refactor the code that chooses which widget to use for drawing under wxQt
No real changes.
2023-12-26 12:45:52 +01:00
ali kettab
ee009a6416 Honor wxALWAYS_SHOW_SB flag if specified under wxQt 2023-12-26 12:45:52 +01:00
ali kettab
31aac5fac4 Get rid of QtGetScrollBarsContainer() from wxWindow API under wxQt
Because It is simpler to initialize (the inherited) m_qtContainer member
directly in derived classes during construction process, and make the API
a little bit cleaner.
2023-12-26 12:45:52 +01:00
ali kettab
5fb8a54e14 Change the return type of QtGetScrollBarsContainer() under wxQt
Neither QListWidget nor QTextEdit derive from QScrollArea and the cast to it is
just UB. Instead, using the common base class QAbstractScrollArea is safer and
eliminates the need to these dangerous and insidious crosscast'ings.
2023-12-26 12:45:52 +01:00
ali kettab
484785fb88 Override {Set,Is}DoubleBuffered() under wxQt
Closes #24136.
2023-12-26 12:45:52 +01:00
ali kettab
de2762bc02 Fix compilation error in auidemo sample under wxQt
Also fix ID_NotebookNoCloseButton menu item ui update which causes
OnUpdateUI() handler to run forever under wxQt.
2023-12-26 12:45:52 +01:00
ali kettab
a6b3efb2cd Always use live resize for wxAUI under wxQt 2023-12-26 12:45:52 +01:00
ali kettab
d44408d448 Fix wxScrollWindow not scrolling by mouse dragging under wxQt
Get rid of wxQtInternalScrollBar and use QScrollArea's scrollbars instead.
2023-12-26 12:45:52 +01:00
ali kettab
6a76e7a610 Fix wxPaintDC under wxQt after the last commits
The {menu,tool,status} bars will not be painted correctly otherwise.
2023-12-26 12:45:52 +01:00
ali kettab
d1be2f42d6 Get rid of unnecessary else statement in QtHandlePaintEvent 2023-12-26 12:45:52 +01:00
ali kettab
5fe4bb90d3 Fix handling paint events under wxQt after the last commit
Qt doesn't allow painting on a widget from a handler of another widget
2023-12-26 12:45:52 +01:00
ali kettab
cace95f4d3 Stop using QScrollArea as a central widget of a wxFrame under wxQt
There's really no need to make the wxFrame itself scrollable as it unnecessarily
complicates the implementation and introduces annoying bugs like content shifted
by 1px. Moreover, the scrolling logic is already encapsulated in other widgets
like wxScrolledWindow which can be used as a hosting container in the frame to
handle scrolling.
2023-12-26 12:45:52 +01:00
ali kettab
1a7f1ccc85 Add missing override to wxQtEventSignalHandler 2023-12-26 12:45:52 +01:00
ali kettab
ed4425bf6e Remove unreferenced defines from wxQt code base 2023-12-26 12:45:52 +01:00
Vadim Zeitlin
ffe15b2fa6 Enable wxAUI_MGR_LIVE_RESIZE by default
This makes behaviour more consistent across all platforms, as this flag
is always used in wxGTK and wxOSX, and might avoid some problems in
wxMSW, see #23982.
2023-12-26 03:38:08 +01:00
DjPasco
e55d7c1dc3 Scroll by entire rows in wxGrid when they have uniform heights
Set vertical scroll line size to the default row height.

See #23032.
2023-12-26 00:23:06 +01:00
Vadim Zeitlin
438e216236 Don't compute unnecessary hint sizes in unsupported direction
For the toolbars locked in one direction there is no need to compute the
hint size in the other one, so don't bother calling RealizeHelper() for
the non-current orientation in this case.

This is just a small optimization.
2023-12-25 21:52:01 +01:00
Vadim Zeitlin
400ce8b582 Return null from wxGetX11Display() when using Wayland
Returning Wayland display pointer as XDisplay was really confusing and
resulted in more weird crashes than just using null pointer directly.
2023-12-25 21:17:17 +01:00
Vadim Zeitlin
7ea528b280 Simplify wxAuiToolBar resizing code a bit more
No real changes, just remove a duplicate call to wxSizer::SetDimension()
too and call it only once.

Also add some comments to explain what's going on here.
2023-12-25 20:59:27 +01:00
Vadim Zeitlin
d85e26434c Avoid resizing wxAuiToolBar to size in the wrong orientation
This is unnecessary and resulted in sometimes visible flicker, when the
wrong shape of the toolbar could be temporarily seen on screen before it
was replaced with the correct one.

Only set the actual window size in Realize(), and do it only for the
current orientation, instead of doing it in RealizeHelper() which is
called for both the current orientation and the transversal one.

Closes #24023.
2023-12-25 20:54:16 +01:00
Vadim Zeitlin
de4c0af402 Don't duplicate GetClientSize() call
No real changes, just remove a duplicated line.
2023-12-25 20:46:16 +01:00
Vadim Zeitlin
bac0aa0e83 Merge branch 'ui-tests-fixes'
Attempt to work around failures in UI tests under AppVeyor.

See #24162.
2023-12-25 18:02:51 +01:00
Vadim Zeitlin
a2a8fc1d65 Avoid harmless MSVC shadowing warning in the test
Using "argc" and "argv" for parameter names triggers C4458 with MSVS
2022, warning about hiding class members with the same names.

As we can't rename the latter, rename the parameters to avoid this.
2023-12-25 17:56:10 +01:00
Vadim Zeitlin
c53fc91cd6 Pass wxOrientation and not bool to wxAuiToolBar::RealizeHelper()
This makes the code more readable and also simpler as RealizeHelper()
only used its boolean parameter to convert it to wxOrientation anyhow
after the changes of the parent commit.

No real changes.
2023-12-25 17:52:31 +01:00
Vadim Zeitlin
8f822d3c59 Simplify adding spacers in wxAuiToolBar::RealizeHelper()
There is no need to test for the orientation explicitly, as we can just
call AddSpacer() and pass it the spacer size in the direction of the
sizer (which is what we always need).

No real changes, just make the code simpler and nicer to read.
2023-12-25 17:51:05 +01:00
Vadim Zeitlin
bbba3b7cb9 Make wxAuiToolBar::RealizeHelper() return value actually useful
This function used to return bool, but it didn't just always return
true, but it's not even clear how could it possibly fail in theory, so
this was quite useless.

But Realize() itself used GetSize() after each call to RealizeHelper(),
so just make RealizeHelper() itself return this size, which allows to
shorten the code and get rid of a couple of levels of indentation.

No real changes.
2023-12-25 17:39:35 +01:00
Vadim Zeitlin
2573e61c19 Fix harmless MSVC warning about uninitialized variables in a test
MSVS 2022 gave C4701 when std::isinf(d) was used below in release build.
2023-12-25 17:24:55 +01:00
Vadim Zeitlin
a884d7da2f Re-realize wxAuiToolBar from SetOrientation()
This doesn't really change anything because the only existing caller of
SetOrientation() already called Realize() immediately afterwards anyhow
but it seems more logical to do it from SetOrientation() itself, as it
always needs to be done when the orientation changes.
2023-12-25 17:18:17 +01:00
PB
24952d0203 Fix confusing argument names in wxPersistentWindow docs
Use the same argument name as in the actual code in the class
constructor as well as the convenience function, instead of
wrongly copypasted "book".

See also 33de6dc (Fix confusing wxPersistentTLW ctor argument name,
2023-12-22).

Closes #24158.
2023-12-25 17:11:53 +01:00
Vadim Zeitlin
61edcbc5a6 Use WaitForEventAt() in Grid::CellClick test too
This test doesn't use the native header but somehow still fails on
AppVeyor and locally a very failure can be reproduced if the mouse is
moved while the test runs, so check for this here too.
2023-12-25 17:07:53 +01:00
Vadim Zeitlin
216b5a4b23 Also use WaitForEventAt() in Grid::SortClick test case
Abandon this test too if the mouse moves for whatever reason.
2023-12-25 17:07:53 +01:00
Vadim Zeitlin
8218e31418 Abandon tests waiting for mouse events if mouse moved
If the mouse pointer moves, for whatever unexplained reason, the click
is not going to happen, so don't wait for it.
2023-12-25 17:07:53 +01:00
Vadim Zeitlin
ab0a44a63a Give information about which section of grid tests fails
This is useful to see when the failure occurs exactly as the same checks
are performed in 3 different cases.
2023-12-25 15:18:05 +01:00
Artur Wieczorek
5725f0be41 Replace macro with inline function in wxPGPropertyGridIterator-related code
Replace wxPG_ITERATOR_CREATE_MASKS macro with inline function to ensure
type safety.
2023-12-25 15:10:14 +01:00
Artur Wieczorek
6a5b0667b5 Remove macro from wxPGPropertyGridIterator-related code
Remove simple wxPG_ITERATOR_PARENTEXMASK_TEST macro and use just the code
to increase code readability.
2023-12-25 15:10:08 +01:00
Artur Wieczorek
c8552aec0c Make wxPGPropertyFlags a bitmask
To improve type safety of flags.
2023-12-25 15:09:50 +01:00
Vadim Zeitlin
18bba7b70b Document correct way of handling wxAuiNotebookEvents
They need to be handled at wxAuiNotebook level as they are all processed
there and don't propagate up to the parent.

Closes #24118.
2023-12-25 15:01:15 +01:00
Vadim Zeitlin
83707a975d Use ProcessEvent() in wxAuiNotebook code
No real changes, just replace GetEventHandler()->ProcessEvent() with the
calls to this function, which does exactly the same thing, but is
shorter and more clear.
2023-12-25 14:45:20 +01:00
Maarten Bent
3d51977acf
Add debug postfix to libcef_dll_wrapper 2023-12-24 18:06:14 +01:00
Vadim Zeitlin
45d7ac6d94 Don't define a separate wxAuiManager::OnHintActivate()
This was only used under Mac but defined under all platforms.

Don't bother with defining it elsewhere and just use a trivial empty
lambda as wxEVT_ACTIVATE handler under Mac.

Note that it's not really clear if this is still needed neither, but it
doesn't cost much to keep this workaround just in case it is.
2023-12-24 17:21:12 +01:00
Vadim Zeitlin
b1c9ebd7be Don't use wxMiniFrame for hint window under Mac
wxMiniFrame is the same thing as wxFrame there, so there is no point in
using different code path for Mac.

No real changes.
2023-12-24 17:19:29 +01:00
Vadim Zeitlin
e605649f63 Set hint window background directly under Mac too
This does work, contrary to the comment saying that it doesn't: it must
have been when cf6fec73d7 (wxaui flags reworked a bit; allows any
hinting type to be explicity invoked; turning off hinting completely is
not possible; sample updated accordingly, 2006-10-26) was done, but not
any longer.

No real changes, just simplify the code.
2023-12-24 17:15:57 +01:00
Vadim Zeitlin
e4bce8f891 Simplify platform test when creating hint window
Instead of checking for all the other platforms, just check for non-Mac
as the code in this branch should work (and definitely should compile)
in any port and it's just wxOSX which requires special handling here.

This fixes the build under the other platforms (e.g. wxX11) broken by
the changes of e8a6f3b732 (Use wxSYS_COLOUR_HOTLIGHT for hint background
under Mac too, 2023-12-24).
2023-12-24 16:36:54 +01:00
Vadim Zeitlin
219f8908b5 Make hint window fade in animation actually noticeable
Using 5ms delay for the fade in timer and 4 point increment for the
value running from 0 to 50 meant that the entire fade in took 60ms which
wasn't really noticeable, i.e. couldn't be distinguished from not using
fade in at all.

Increase the delay to 15ms (which corresponds to ~60 FPS) and make the
animation last longer by increasing the transparency more progressively
to make the fade in actually visible.

In the future we probably ought to make all the values involved
(animation duration, initial and end values and the step) configurable
by adding some SetHintFadeInOptions() to wxAuiManager.
2023-12-24 16:21:37 +01:00
Vadim Zeitlin
48982e5aa4 Initialize m_hintFadeAmt in a more logical way
No changes, just don't make the code a bit more clear.
2023-12-24 16:15:15 +01:00