Commit graph

75545 commits

Author SHA1 Message Date
Vadim Zeitlin
298fef23ad Use wxClientDC::CanBeUsedForDrawing() in wxSplitterWindow
No real changes, just simplify the code by using the just added
wxClientDC function instead of reproducing its logic here.
2023-12-26 19:27:50 +01:00
Vadim Zeitlin
24fd54ed31 Add wxClientDC::CanBeUsedForDrawing()
This function can be used to check if drawing on wxClientDC actually
works. This has to be a run-time, rather than compile-time, check
because in wxGTK3 this depends on the backend being used: wxClientDC
only doesn't work with Wayland, but does work with X11 (and, less
importantly, Win32) backend(s).

Currently the wxWindow parameter of this function is not used but it
could be useful in the future and it will be simpler to allow not
specifying it (by defaulting it to nullptr) than to add it later, so it
seems better to have it.
2023-12-26 19:27:50 +01:00
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
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
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
Blake-Madden
0a743cdf12 Don't free a locked HGLOBAL in wxMSW printing code
This resulted in at least a use-after-free ASAN warning and possibly
actual memory corruption, so ensure that we unlock m_devMode before
freeing and resetting it.

Closes #24146.

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
2023-12-18 19:57:28 +01:00
Bill Su
ff68b61b84
Update interface/wx/valgen.h
Co-authored-by: VZ <vz-github@zeitlins.org>
2023-12-18 11:43:28 -05:00
Vadim Zeitlin
50325bd2cd Reset stored position in wxMSW wxFileDialog dtor, not ctor
As there is more then one ctor since 11ed91af8f (Add missing default
constructor of wxFileDialog in wxMSW, 2023-12-03), this code would need
to be duplicated in the default ctor too now, but it seems simpler and
more logical to move it to the dtor instead.

See #24113.
2023-12-18 16:51:58 +01:00
Vadim Zeitlin
f8a6f0cd39 Initialize wxFileDialog::m_data in default ctor in wxMSW too
This corrects a problem introduced in 11ed91af8f (Add missing default
constructor of wxFileDialog in wxMSW, 2023-12-03) as m_data remained
uninitialized when default ctor was used.

See #24113.
2023-12-18 16:49:35 +01:00
Vadim Zeitlin
eabaec546b Restore "wxSuffix" MSBuild macro for compatibility
Restore the macro removed in 0d6f2f2b85 (Remove wxSuffix from MSBuild
files, it's always "u" now, 2022-10-28) as it can still be used in the
user projects importing wx properties files and it doesn't cost anything
to keep it.
2023-12-18 15:06:33 +01:00
Blake-Madden
0a1042292d Don't add new line when copying only one wxGrid cell to clipboard
Append the new line character only before starting the next line instead
of doing it after each line to avoid having it when there is just one
line, as this as unexpected when copying a single cell.

Closes #24139.
2023-12-18 14:09:37 +01:00
Artur Wieczorek
41109f64f0 Initialize member variables 2023-12-17 16:47:52 +01:00
Artur Wieczorek
74bacb097f Guard function with wxCHECK rather than wxASSERT 2023-12-17 16:47:46 +01:00
Artur Wieczorek
d95074e48d Use dedicated function to get value from wxPGChoicesData 2023-12-17 16:47:40 +01:00
Artur Wieczorek
63805074df Use standard library function to swap items in the array 2023-12-17 16:47:35 +01:00
Artur Wieczorek
a8f3e0da70 Get rid of of unsupported overloads of wxIntProperty::DoValidation()
wxIntProperty::DoValidation() overloads for wxLongLong_t and wxULongLong_t
parameters are not supported because for these types there are no direct
conversions to wxVariant.
Arguments of such types will be handled by overloads for wxLongLong
and wxULongLong.
2023-12-17 16:47:30 +01:00
Artur Wieczorek
6afdde58b5 Make wxFloatProperty wxUILocale-aware.
wxUILocale settings (especially decimal separator) needs to be taken
into account while formatting and validating numbers.

Closes #24140.
2023-12-17 16:47:18 +01:00
Bill Su
fb6a7d5a8e wxGenericValidator: add support for wxCheckBoxState 2023-12-17 02:10:51 -05:00
Bill Su
486b25bd2a fix #include <> to "" 2023-12-14 21:26:57 -05:00
Bill Su
4d3acc90d7 wxGenericValidator: add wxColourPickerCtrl support 2023-12-14 19:17:32 -05:00
Bill Su
ea4800fcb9 comment that single-select wxListBox allows works with int 2023-12-14 18:58:53 -05:00
Bill Su
8dc3ef4307 document wxListBox::HasMultipleSelection() as public API 2023-12-13 18:31:54 -05:00
Bill Su
bdfeb19d19 HasMultipleSelection() is clearer than handling style bits 2023-12-13 18:26:19 -05:00
Bill Su
cfc5bc6ff2 more convenient API for wxGenericValidator + wxLB_SINGLE
For a single-selection wxListBox, using an int to transfer
data to/from wxGenericValidator is more convenient than
wxArrayInt.
2023-12-12 20:58:40 -05:00