Commit graph

283 commits

Author SHA1 Message Date
Vadim Zeitlin
a6cc89777b Allow passing -1 to wxPGProperty::SetChoiceSelection() again
This used to be possible in 3.0 but was disallowed back in 29bf859fae
(Check if new index is in range before selecting new value in
wxPGProperty::SetChoiceSelection., 2014-11-29). However there doesn't
seem to be any real harm in still allowing to do this, so handle -1 as a
special case here.

Closes #24279.

Closes #24281.
2024-02-09 17:21:52 +01:00
Vadim Zeitlin
9550c37e29 Support inherited attributes in wxPropertyGrid XRC handler
Allow specifying recurse="1" to inherit the attribute, as this is much
nicer than having to specify it for all the children.

Also add support for this to wxPropertyGridPopulator, which is used by
the XRC handler.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
99eca07ac5 Some minor spelling fixes in wxPropertyGrid documentation
Also fix a couple of things in the actual header for consistency with
the same fixes done in the documentation.

No real changes.
2024-01-30 01:55:14 +01:00
mcorino
c1b7ce5932 Fix typing error in interface def.
missing whitespace between arg type and name
2024-01-10 17:56:08 +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
Artur Wieczorek
c8552aec0c Make wxPGPropertyFlags a bitmask
To improve type safety of flags.
2023-12-25 15:09:50 +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
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
Artur Wieczorek
2cdca2d744 Deprecate wxPGPropertyFlags that are intended for internal use 2023-09-22 23:39:53 +02:00
Artur Wieczorek
11582b4082 Refactor wxFlagsProperty to simplify initialization 2023-09-22 23:39:53 +02:00
Artur Wieczorek
5a87cbdf3d Use enum class to represent wxPGKeyboardActions 2023-09-22 23:39:53 +02:00
Artur Wieczorek
9cb4d8fbbe Save keyboard actions as std::pair in wxPropertyGrid
Store two possible action codes in std::pair instead of packing them
into one int value with bitmasks. This reduces level of indirection
in accessing keyboard actions and make the code more maintainable.
2023-09-22 23:39:52 +02:00
Vadim Zeitlin
b4ab8de248 Avoid deprecation warnings due to recent wxPropertyGrid changes
Rename the new overload of DoSetSplitterPosition() to use a different
name: not only this avoids deprecation warnings that broke all the CI
builds, but it also makes things more clear and simpler to use as all
the derived classes don't need to override both the deprecated overload
and the new one to avoid warnings about hiding a base class virtual
function and can just override the new one.

Also remove the default value "Refresh" for the flags which seems to be
inconsistent with the default value "Null" used elsewhere and prefer to
specify it explicitly.
2023-02-19 23:38:04 +01:00
Artur Wieczorek
f1273ce152 Use class enums to implement bitmask types
To improve type safety of flags.
2023-02-19 22:36:21 +01:00
Artur Wieczorek
159c3b1c6d Don't cache strings and variant values in wxPGGlobalVarsClass
Optimization gain is doubtful but complexity is high.
2023-02-05 19:07:25 +01:00
Artur Wieczorek
5b92a7badc Use constexpr to declare constants in wxPropertyGrid 2023-01-22 20:15:01 +01:00
Artur Wieczorek
f0b76076f4 Encapsulate data in wxPGValidationInfo
Implement more getters and setters to encapsulate data
in wxPGValidationInfo.
2023-01-06 18:06:38 +01:00
Artur Wieczorek
d3c194590d Prevent from instantiation of wxPropertyGridIteratorBase
The purpose of this class is to be a base class
for wxPropertyGridIterator classes.
2022-12-30 14:10:29 +01:00
Artur Wieczorek
cf661f9293 Specify what is the limit set by wxPGProperty::SetMaxLength()
It needs to be stated clearly that the limit applies only to the text
the user can enter in the editor associated with property.
This constraint does not apply to the length of text represenations
of values set programmatically.
Corresponding test were added.
2022-12-22 20:53:44 +01:00
Artur Wieczorek
1d85e22543 Implement new wxPGProperty::HasAnyChild() method
There are many checks in the code whether wxPGProperty has any child.
Doing so by checking if GetChildCount() is greater than zero doesn't
seem to express intent simply and clearly. With dedicated method this
could be done simpler and hopefully in a more optimal way.
2022-12-03 17:15:28 +01:00
Artur Wieczorek
811cdc0ffc Use wxString() rather than wxEmptyString in wxPropertyGrid classes 2022-10-26 13:11:59 +02:00
Artur Wieczorek
2369557963 Use wxVariant() instead of wxNullVariant 2022-10-26 12:07:39 +02:00
Vadim Zeitlin
4f4c5fcfdf Use nullptr instead of NULL in the code and documentation
This is a combination of running clang-tidy with modernize-use-nullptr
check for some ports (GTK, X11, OSX) and manual changes to the ports for
which it couldn't be used easily (MSW, DFB) and also manually updating
the docs.

Also replace NULL with null or nullptr in the comments as this is more
consistent with the use of nullptr in the code and makes it simpler to
grep for the remaining occurrences of NULL itself.

And also use null in the assert messages.

Only a few occurrences of "NULL" are still left in non-C files, mostly
corresponding to unclear comments or string output which it might not be
safe to change.
2022-10-18 01:25:25 +02:00
PB
88d526660f Replace wxOVERRIDE and wxNOEXCEPT with override and noexcept
Don't use deprecated macros in wxWidgets itself.
2022-10-15 18:10:45 +02:00
Scott Talbert
dc4d1b66e4 Fix documentation for wxPropertyGridPageState::GetColumnFullWidth 2022-06-08 08:59:53 +02:00
Artur Wieczorek
b72a742b21 Decouple wxPropertyGridPageState from wxDC
Reimplement functions to calculate column widths to do that without
referring to wxClientDC.
2022-05-30 19:17:37 +02:00
Artur Wieczorek
763f4141bc Don't expose internal wxPropertyGridPageState functions
Functions designed for internal use shouldn't be exposed as public ones
to avoid calling them directly from the user code by mistake.
2022-05-30 19:13:33 +02:00
Artur Wieczorek
2aa6259aa4 Pass const pointer as a parameter 2022-05-27 19:13:42 +02:00
Artur Wieczorek
502ede23ab Don't expose internal wxPropertyGridPageState functions
Functions designed for internal use shouldn't be exposed as public ones
to avoid calling them directly from the user code by mistake.
2022-05-27 19:13:42 +02:00
PB
97aae519fa Add "events" category to wxEvent-derived classes docs where missing
If a wxEvent-derived class documentation lacks "events" category,
the class will not appear in the Events class list.

The "events" category is still missing in several event classes
(e.g., palette events or wxRibbonToolBarEvent), but those lack
actual documentation aside from just methods declarations anyway.
2022-05-23 19:06:55 +02:00
Artur Wieczorek
547afc66c4 Pass large object by a const reference 2022-05-21 22:03:08 +02:00
Artur Wieczorek
b06b950574 Document changes in wxImageFileProperty
Remove references to the non-public member variables
from documentation.
2022-04-18 22:17:31 +02:00
Artur Wieczorek
04bad7a720 Preserve original image in wxImageFileProperty
Rescale only the copy of the original image to preserve image quality.
2022-04-10 13:34:03 +02:00
Artur Wieczorek
9542e86770 Don't store wxImage/wxBitmap objects on the heap in wxImageFileProperty
To simplify managing the life cycle of the objects.
2022-04-10 13:31:14 +02:00
Artur Wieczorek
fd11c4e50a Remove from documentation reference to not implemented function 2022-04-10 13:27:58 +02:00
Artur Wieczorek
7e4cd9f1c1 Get rid of unnecessary friend classes 2022-01-30 10:33:17 +01:00
Artur Wieczorek
bd784b3186 Refactor functions converting wxArrayString to string in wxArrayStringProperty::GenerateValueAsString()
Because ConvertArrayToString() and ArrayStringToString() produce string
values it would more intuitive to just to return this string as a function
value instead of passing it through the parameter.
2022-01-29 20:32:09 +01:00
Artur Wieczorek
6d318ad0e2 Refactor wxMultiChoiceProperty::GenerateValueAsString()
Because this function produces a string value it would more intuitive to
just to return this string as a function value instead of passing it
through the parameter.
2022-01-29 00:12:27 +01:00
Artur Wieczorek
3c87cc1e49 Get rid of unused member variable 2022-01-28 23:55:12 +01:00
Artur Wieczorek
87394856f5 Use wxBitmapBundle in wxPropertyGrid 2021-11-19 17:52:56 +01:00
Artur Wieczorek
f989b1b875 Rephrase descriptions of some parameters of wxPGManager functions 2021-11-17 23:06:23 +01:00
Artur Wieczorek
12af82ca38 Use wxBitmapBundle in wxPropertyGridManager
wxBitmapBundle can be used in wxPropertyGridManager to pass images
to the toolbar.
2021-11-14 19:16:00 +01:00
PB
b9f22fc633 Replace wxEvtHandler::Connect() with Bind() in the docs
In the docs, replace mentions of wxEvtHandler::Connect() with
wxEvtHandler::Bind(), mostly to match the actual code but also
because Bind() is the recommended way to dynamically bind events.

Closes https://github.com/wxWidgets/wxWidgets/pull/2298
2021-03-31 03:04:49 +02:00
Blake Madden
28d705424b Fix double words and article mismatches in docs. 2021-03-10 14:28:20 -05:00
Satya Das
86a3578a11 Fix syntax error in interface headers
Although these headers are not supposed to be compiled, it's still
better to avoid at least the obvious typos in them.

Closes https://github.com/wxWidgets/wxWidgets/pull/2140
2020-12-10 22:53:11 +01:00
Vadim Zeitlin
e4333fdeac Fix recurrent typo in "usable"
This word has a single "e".
2020-09-02 20:49:39 +02:00
Vadim Zeitlin
d7f19ee610 Fix spelling in comments and documentation using codespell
Apply the utility from https://github.com/codespell-project/codespell/
to fix spelling issues in the headers under both include and interface
directories and add a file with a couple of exceptions.

The exact command line used was:

    $ codespell -w -I misc/scripts/codespell.ignore -i 3 in*
2020-06-27 22:56:22 +02:00