Commit graph

4871 commits

Author SHA1 Message Date
Vadim Zeitlin
6586afb0a5 Use XDG-compliant location by default in wxFileConfig
Still use the traditional dot file if it already exists, but prefer
using the new location otherwise, i.e. for the new program installation.

Add wxCONFIG_USE_HOME to allow forcing the use of the old location if
really necessary.

Also use the new style as default "old style" of MigrateLocalFile() so
that calling it even when using XDG layout in wxStandardPaths still
works as expected.
2024-01-08 00:43:26 +01:00
Vadim Zeitlin
b294a6b2bc Merge branch 'config-xdg'
Make it easier to use wxFileConfig in XDG-compliant way.

See #24180.
2024-01-07 16:13:15 +01:00
Vadim Zeitlin
cc8fbeed56 Merge branch 'xml-conv-simplify'
Simplify and modernize wxXmlDocument code.

See #24179.
2024-01-07 16:12:31 +01:00
Artur Wieczorek
efa2870cb4 Rename wxPGKeyboardActions type to wxPGKeyboardAction
For regular enumeration singular name is more appropriate.
2024-01-06 22:42:55 +01:00
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
Vadim Zeitlin
486865b446 Add wxFileConfig::MigrateLocalFile()
This can be useful for the existing applications switching to using
XDG-compliant config files location as they can just call this function
on startup to keep using the existing file.
2024-01-04 03:23:37 +01:00
Vadim Zeitlin
ebe0847932 Add wxHAS_CONFIG_AS_{REG,FILE}CONFIG symbols
Sometimes it's useful to have some code used only if wxConfig is defined
as wxRegConfig or only if it is defined as wxFileConfig and testing for
these symbols is more clear than testing for the platform (and more
correct, considering that setting wxUSE_CONFIG_NATIVE to 0 may result in
wxFileConfig being used even under Windows).
2024-01-04 02:55:05 +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
3093d7ad4f Add wxCONFIG_USE_XDG to use with wxFileConfig
Using this style allows to tell wxFileConfig to use XDG-compliant
location for the user configuration file, even when not using XDG file
layout for wxStandardPaths, which can be convenient when modifying the
existing application using wxStandardPaths for other files locations
too.

And using it in combination with wxCONFIG_USE_SUBDIR allows to put the
config file in a XDG-compliant subdirectory, which wasn't easily
possible at all before.
2024-01-02 02:18:45 +01:00
Vadim Zeitlin
d56cf71466 Add wxStandardPaths::Dir_Config
This allows using GetUserDir(Dir_Config) to retrieve XDG-compliant
location of the configuration files, independently of the file layout
used by the global wxStandardPaths object.

Recommend using this directory instead of GetUserDataDir() for multiple
configuration files under Unix.
2024-01-02 02:07:25 +01:00
Vadim Zeitlin
72c164f28c Make wxStandardPaths::AppendAppInfo() public
This function can be useful to the application code and will be used by
wxFileConfig in the upcoming commits.
2024-01-02 01:57:04 +01:00
Vadim Zeitlin
420983f76a Document that GetUserDataDir() doesn't respect XDG file layout
And recommend using GetUserDir() instead.
2024-01-02 01:47:26 +01:00
Vadim Zeitlin
20845d85a5 Deprecate "encoding" parameter of wxXmlDocument ctor and Load()
This parameter wasn't used for anything as it specified the encoding of
the data contents in memory and not the encoding of the XML file as
might be believed, so it only created unnecessary confusion.

See #24167.
2024-01-01 22:08:28 +01:00
Vadim Zeitlin
9ee9f4e8dd Remove documentation of wxXmlDocument::GetEncoding()
This function was removed in 4519d8e08a (Remove wxUSE_UNICODE checks as
they're always true now, 2022-10-27).
2024-01-01 21:00:08 +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