Commit graph

4859 commits

Author SHA1 Message Date
Artur Wieczorek
3cb3d62212 Use enum class to represent NumericType
This is for better type safety.
2024-01-06 22:42:49 +01:00
Artur Wieczorek
e7ab6a6d53 Use enum class to represent wxPGNumericValidationConstants
This is for better type safety.
2024-01-06 22:42:43 +01:00
Artur Wieczorek
ca3acd7a03 Use enum class to implement wxPGPropValFormatFlags as bitmask
This is for better type safety of the flags.
2024-01-06 22:42:38 +01:00
David Miguel Susano Pinto
68bef2fbf3 Add compound operators * and / to wxPoint and wxRealPoint
Also add unit tests for them as well as for the existing additive
compound operators.
2024-01-05 19:34:43 +01:00
David Miguel Susano Pinto
1300c56f0d Put wxRealPoint operators in the same order as wxPoint ones 2024-01-05 19:31:14 +01:00
David Miguel Susano Pinto
11c3034177 Implement unary minus for wxRealPoint, same as wxPoint. 2024-01-05 12:44:11 +00:00
David Miguel Susano Pinto
8638db50da Document a series of undocumented wxPoint and wxRealPoint operators.
Unary minus of wxPoint and multiplication with double are implemented
but undocumented.  Many of operators that use integers types other
than int remain undocumented though.
2024-01-05 12:44:11 +00:00
David Miguel Susano Pinto
9a5d2ffade Correct names of variables in wxPoint and wxRealPoint arithmetic operators.
The arithmetic operators for wxPoint and wxRealPoint are quite
repetitive and were made by copy-paste from the wxSize operators.
Because of that, some of the names are a bit misleading which this
commit changes.  The changes are:

1. replace s/sz with p/pt for point variables (likely 's' comes from
   copied code used for wxSize variables)

2. replace 'i' with 'f' for floating point types (likely 'i' comes
   from copied code used for integer types)

3. replace 'factor' with 'divisor' for division operations (factors
   are the multiplication operands, not division)
2024-01-05 11:28:11 +00:00
David Miguel Susano Pinto
11ebffe7b0 Add operator/(wxPoint, double) and operator/(wxRealPoint, double)
Do this for consistency with wxSize which already had this operator/()
overload and operator*() in these classes which was already overloaded
for double.

Closes #24185.

Closes #24187.
2024-01-05 00:45:57 +01:00
David Miguel Susano Pinto
a8b14edc40 Correct wxRealPoint and wxPoint operator return types in the docs
Use the correct types instead of wxSize which was erroneously used
there ever since a5664fd6ef (Increase interoperability between wxPoint
and wxRealPoint introducing constructors which convert between the two
classes., 2010-06-09).

Closes #23804.
2024-01-03 20:24:17 +01:00
Vadim Zeitlin
acf113f3f9 Update copyright years to 2024
Just run misc/scripts/inc_year and commit the results.

See #18690.
2023-12-31 18:56:06 +01:00
Martin Corino
6ee9056c16 Fix column reordering in wxHeaderCtrlSimple and related problems
Override required functions in wxHeaderCtrlSimple to avoid asserts if
its columns are reordered.

Also bring the code behaviour in agreement with the documentation by
calling UpdateColumn() after calling UpdateColumnVisibility().

Finally, only call UpdateColumnsOrder() if the corresponding event was
not processed as the application should use one xor the other mechanism
for reacting to columns reordering, but not both.

Closes #24108.

Closes #24172.
2023-12-31 17:57:19 +01:00
Vadim Zeitlin
927590fbcd Merge branch 'qt-richtooltip-fixes' of https://github.com/AliKet/wxWidgets
wxRichToolTip fixes for wxQt port.

See #24170.
2023-12-31 17:48:37 +01:00
Paul Cornett
ce1d317768 Remove GLU dependency
See #23721
2023-12-28 14:49:42 -08:00
AliKet
b284260191
Update interface/wx/nonownedwnd.h
Co-authored-by: VZ <vz-github@zeitlins.org>
2023-12-28 16:35:23 +01:00
ali kettab
c7fdb41fcd Implement wxNonOwnedWindow::SetShape() taking wxGraphicsPath under wxQt
This is a copy and paste of wxMac's implementation to make wxRichToolTip
work under wxQt.
2023-12-27 19:17:21 +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
Artur Wieczorek
c8552aec0c Make wxPGPropertyFlags a bitmask
To improve type safety of flags.
2023-12-25 15:09:50 +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
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
Bill Su
ff68b61b84
Update interface/wx/valgen.h
Co-authored-by: VZ <vz-github@zeitlins.org>
2023-12-18 11:43:28 -05:00
Bill Su
fb6a7d5a8e wxGenericValidator: add support for wxCheckBoxState 2023-12-17 02:10:51 -05:00
Bill Su
4d3acc90d7 wxGenericValidator: add wxColourPickerCtrl support 2023-12-14 19:17:32 -05:00
Bill Su
8dc3ef4307 document wxListBox::HasMultipleSelection() as public API 2023-12-13 18:31:54 -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
Blake-Madden
6d89a14c72 Add wxGrid::CopySelection()
This code was already used for Ctrl-C handling, refactor it into a
separate function that can be called from the application now.

This commit is best viewed with --color-moved-ws=ignore-all-space Git
option.

Closes #24124.
2023-12-12 20:18:59 +01:00
Blake-Madden
5ba009e861 Add Catholic Feasts holiday authority class (US observances)
This includes a static function to calculate Easter that can be used for
other authorities.

Document the wxDateTimeWorkDays and wxDateTimeHolidayAuthority classes.

Closes #24094.
2023-12-05 00:53:26 +01:00
ali kettab
2c9fee3d6f Add wxStatusBar::AddFieldControl() to simplify adding controls
This allows user codes to simply designate where their controls should
appear in the status bar without the need to handle wxEVT_SIZE
themselves.

They can still handle the event if the default positioning does not meet
their needs, but the new API is simpler and can be implemented for wxQt.

Closes #24092.
2023-12-05 00:39:04 +01:00
Martin Corino
ed02e03585 Make wxEL_ALLOW_NEW imply wxEL_ALLOW_EDIT in wxEditableListBox
Without this change, using wxEL_ALLOW_NEW without wxEL_ALLOW_EDIT
resulted in an assertion failure, so fix it by turning wxEL_ALLOW_EDIT
too in this case: this makes sense because adding a new element is
"editing" too, and there doesn't seem to be any realistic scenario in
which new items can be added but the existing items can't be changed.

Closes #24099.

Closes #24100.
2023-12-03 15:05:36 +01:00
Blake-Madden
2c1cdf9c02 Fix typos and repeated words in comments and documentation
Closes #24085.
2023-11-30 02:21:34 +01:00
Blake-Madden
49ddc51007 Add bullet number and style support to MSW wxTextCtrl
Make bullet style-related functions in wxTextAttr work for the native
(rich) text controls too.

Closes #24069.
2023-11-30 01:53:50 +01:00
taler21
7a1c8d39f8 Fix references to wxEventLoop::YieldFor() in the documentation
It was incorrectly called wxAppConsole::YieldFor() but the function was
moved from wxAppConsole to wxEventLoopBase back in dde19c2180 (second
part of #10320: move wxApp event handling functions to wxEventLoopBase
(in particular move Yield() functions); add backward compatible
redirections to wxApp; update docs; remove global lists wxPendingEvents
and wxPendingEventsLocker, 2009-02-15).

Closes #24095.
2023-11-29 22:16:03 +01: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
Martin Corino
e64118658d Add documentation for wxSizerFlags::HorzBorder()
Closes #24059.
2023-11-17 01:22:53 +01:00
Blake-Madden
1d7f2becd4 Add line spacing support to MSW wxTextCtrl
Also expand and improve wxTextAttr documentation by mentioning where is
each attribute supported.

Closes #24046.
2023-11-17 01:11:14 +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
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
Paul Cornett
56303c6236 Document wxDisplay::GetDepth()
Should have been part of
24b5e256df (Add wxDisplay::GetDepth() and use it for wxDisplayDepth(), 2018-10-06)
2023-11-16 10:06:57 -08:00
Paul Cornett
2d07dd25b4 Improve desktop environment detection
Add code that works for Wayland, and any DE
2023-11-10 11:23:24 -08: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
163d310369 Use wxTimer::StartOnce() instead of wxTIMER_ONE_SHOT
This is more readable and shorter, so encourage using this form.

No real changes.
2023-11-07 19:01:38 +01:00
Vadim Zeitlin
1761bc3a88 Update documentation of wxTaskBarIcon limitations
Don't mention thoroughly outdated desktop environments such as Gnome 1
and don't make this X-specific as the situation is not at all better
with Wayland.

Do mention IsAvailable().

See #18081.

Closes #24028.
2023-11-07 02:32:20 +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
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
Blake-Madden
9bae94022c Fixes for wxTextProofOptions documentation
Fix missing semicolons causing help parsing to break.

Document Language().

Fix typo.

Closes #24026.
2023-11-03 00:52:12 +01:00
Martin Corino
8fc73d45ce Document wxPGSelectPropertyFlags enum
This enum is used in the public API and so needs to be documented.

Closes #23980.
2023-10-29 02:54:03 +02:00