Commit graph

75564 commits

Author SHA1 Message Date
Paul Cornett
fc8a780932 Avoid applying "no-window" mouse coordinate conversion to generic wxWindow
For a wxPizza widget in a GtkScrolledWindow, the coordinates are already correct.
2023-12-28 12:32:59 -08:00
Paul Cornett
6cb6cf1fde Use correct comparison for out-of-window mouse coordinate
Coordinates on a window are 0..size-1
2023-12-28 12:26:24 -08:00
Vadim Zeitlin
7a306c4a42 Merge branch 'qt-fixes' of https://github.com/AliKet/wxWidgets
Many wxQt improvements and simplifications.

See #24135.
2023-12-27 02:57:14 +01:00
Vadim Zeitlin
378da09c84 Fix typo in "receive" occurring a few times
This is just too annoying to see.
2023-12-27 02:56:20 +01:00
Vadim Zeitlin
5f62f30231 Use WaitForEventAt() in Grid::CellSelect test too
Try making this test more robust as well as it also sporadically fails
on AppVeyor.

Also simplify it a bit, checking for each of the expected events in turn
instead of checking for their total number at the end.
2023-12-27 02:49:53 +01:00
ali kettab
a0b0f524ff Handle wxTextCtrl created with wxTE_DONTWRAP or wxTE_NO_VSCROLL under wxQt 2023-12-26 22:50:59 +01:00
ali kettab
0eaff271ed Fix wxStaticBitmap not using correct bitmap size under wxQt 2023-12-26 22:50:59 +01:00
ali kettab
0fb1a74983 Fix Set{Back,Fore}groundColour() for wxFrame under wxQt
Restrict the effect of these functions to the central widget only.
Otherwise the menubar, toolbar and statusbar would also be affected.
2023-12-26 22:50:59 +01:00
ali kettab
aa562ea2fb Get rid of QtCreateControl() from wxQt code base
If possible, all windows should call wxWindow::Create() on creation now,
because among other things:
- It manages generic and non-generic windows uniformly and transparently
- It ensures an appropriate initial size for the window
- AddChild() and PostCreation() are automatically called
- Scrollbar policies are set in one place.
2023-12-26 22:50:59 +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
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
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
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
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
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
Artur Wieczorek
1b5a43599a Preserve wxPGProperty parent while adding property to alphabetic items array
Real wxPGProperty parent has to be preserved for wxPropertyGridIterator
to work properly.
2023-12-23 18:58:33 +01:00
Artur Wieczorek
6dd129049f Initialize array for wxPropertyGrid alphabetic mode only once
Array holding items to use in non-categoric mode should be created and
initially populated only once.

Closes #24145.
2023-12-23 18:57:38 +01:00
Vadim Zeitlin
99434fa005 Add wx/persist/combobox.h to the headers list
In particular this ensures that it is installed by "make install".

See #24157.
2023-12-22 18:43:57 +01:00
Vadim Zeitlin
27585bf2c3 Hardcode minimal widget sample notebook size
Not doing this resulted in the window being tiny by default, so it's
better than nothing, even if it's clearly still not ideal.

See #24154.
2023-12-22 17:40:00 +01:00
ali kettab
7c592ba361 Make WidgetsPage pages scrollable in the widgets sample
Because some pages in the sample contain too much content to fit entirely
in the visible area of the page. Under wxQt port, this is true regardless
of the state of the window (whether it is maximized or not) some content
remains hidden and inaccessible.

Closes #24154.
2023-12-22 12:29:45 +01:00
Blake-Madden
a059061eb7 Replace wxDECLARE_NO_COPY_CLASS with deleted functions in samples
Use standard C++11 way of making classes non-copyable instead of
wx-specific macro.

Closes #24150.
2023-12-22 12:21:54 +01:00
mcorino
33de6dce6f Fix confusing wxPersistentTLW ctor argument name
Fix an obvious copy/paste error.

Closes #24156.
2023-12-22 12:18:29 +01:00
mcorino
f80e2459de Fix missing semicolon in HasMultipleSelection() documentation
Missing semicolon on latest method addition causes doxygen parsing
issues which in turn causes problems for dependent projects like wxRuby
and wxPython.

Closes #24155.
2023-12-22 12:18:29 +01:00
Scott Hanson
1bf80138e9 Fix wxDir compilation with wxUSE_STD_STRING_CONV_IN_WXSTRING
When enabling this build option, implicit conversion to wchar_t * is
not available, so convert wxString to it explicitly.

Closes #24149.
2023-12-22 12:18:29 +01:00
Paul Cornett
44248eb78a Support setting thickness when creating wxGauge with GTK >= 3.20
This stopped working in GTK 3.14, but became possible to fix in 3.20
with the addition of the "min-width"/"min-height" properties.
See #24107
2023-12-21 12:31:25 -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
68eaff5c02 Merge branch 'valgen-wxlb_single' of https://github.com/wsu-cb/wxWidgets
Extend wxGenericValidator to work with single selection wxListBox,
3-state wxCheckBox and wxColourPickerCtrl.

See #24134.
2023-12-18 20:02:24 +01:00