Commit Graph

448 Commits

Author SHA1 Message Date
Artur Wieczorek
2a536c359c Fix visual state of enabled/disabled wxPropertyGrid
wxPropertyGrid needs to be refreshed while enabling/disabling to display
proper visual states of all wxPGProperty items.
2021-03-12 21:41:40 +01:00
Pavel Tyunin
47d8299c70 Make wxPG_TOOLTIPS work for >2 columns too 2020-09-21 11:27:42 +02:00
Vadim Zeitlin
e4333fdeac Fix recurrent typo in "usable"
This word has a single "e".
2020-09-02 20:49:39 +02:00
Arrigo Marchiori
c86bcf962d Use wxASCII_STR() on string literals
Fix the build with wxNO_IMPLICIT_WXSTRING_ENCODING.
2020-07-17 17:52:16 +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
Artur Wieczorek
8a9e5e5ac7 Implement method to set items of wxPGChoiceEditor
In addition to the current methods to add/delete one item to the control
we would need a method to replace all existing control items with new ones
at once.
2020-05-01 17:57:46 +02:00
Artur Wieczorek
c4f5fd3581 Move duplicated code to rescale the bitmap to the shared function 2020-04-10 20:45:34 +02:00
Artur Wieczorek
5bc020e844 Implement getters for members of wxPGWindowList
There is no reason to expose wxPGWindowList member variables. They should
be set in ctors and retrieved with getters.
2020-02-12 17:09:25 +01:00
Artur Wieczorek
c7c3f337c2 Check index value with CHECK_MSG to avoid crashes 2020-02-09 20:39:06 +01:00
Artur Wieczorek
9dbd3b4946 Use ctor with default argument instead of providing specialized ctor
We can use 2-parameter ctor with default NULL value for second parameter
instead of providing a special 1-paramater ctor.
2020-02-09 20:31:58 +01:00
Artur Wieczorek
f2f9cbe619 Get rid of unused wxPGWindowList ctor
There is no use case for wxPGWindowList initialiazed with NULL data.
2020-02-09 20:19:52 +01:00
Paul Cornett
948ddc6e0f Eliminate -Wcast-qual warnings with GCC and Clang
Use const_cast, mutable, and various other changes to avoid -Wcast-qual
2020-02-02 22:50:32 -08:00
Maarten Bent
c6ce2a77bf Fix wxEditorDialogProperty type declaration 2019-11-29 00:23:26 +01:00
Artur Wieczorek
9e4d28ba7f Fix names of wxDirProperty ctor parameters
First two paramaters of ctors of wxPGProperty and its derivates are named
'label' and 'name' so wxDirProperty ctor should conform to this convention.

Close #18547.
2019-10-29 23:34:37 +01:00
Maarten Bent
a1c3fa0468 Fix wxPropertyGrid row height on DPI change
Fix collapse button size of wxPropertyGrid in High DPI.
2019-10-07 00:54:59 +02:00
Vadim Zeitlin
20b9964007 Avoid warnings about deprecated wxPG_XXX when building wx itself
Getting the warnings about deprecated macros when building the library
itself is not useful, as it must continue to use them as long as
WXWIN_COMPATIBILITY_3_0 exists.

Closes https://github.com/wxWidgets/wxWidgets/pull/1510
2019-08-27 22:21:01 +02:00
Paul Cornett
fca4ef0458 Use wxDC rather than wxClientDC for parameter type 2019-08-25 20:53:33 -07:00
Paul Cornett
b200c661ed Fix wxPropertyGrid headers so they can be compiled independently
See #18465
2019-08-15 17:27:07 -07:00
Artur Wieczorek
eca1e857fe Remove unnecessary headers from wxPropertyGrid files
Currently there are included plenty of headers which are apparently not necessary.
2019-08-04 20:20:48 +02:00
Artur Wieczorek
c623d9cfc5 Remove references to unused internal flags 2019-08-04 20:20:48 +02:00
Artur Wieczorek
b06a9d227f Replace wxPG_FILE_DIALOG_TITLE and wxPG_DIR_DIALOG_MESSAGE attributes with wxPG_DIALOG_TITLE
Current wxPG_FILE_DIALOG_TITLE and wxPG_DIR_DIALOG_MESSAGE attributes can be used to customize editor dialog titles only for wxFileProperty and wxDirProperty, respectively. New wxPG_DIALOG_TITLE property is applicable to all properties derived from wxEditorDialogProperty so not only editor dialog titles for wxFileProperty and wxDirProperty can be set but also for wxFontProperty, wxLongStringProperty, etc.
wxPG_FILE_DIALOG_TITLE and wxPG_DIR_DIALOG_MESSAGE attributes are marked obsolete.
2019-08-04 20:20:19 +02:00
Maarten Bent
2815870507 Resolve some extra semicolon warnings 2019-07-21 17:15:02 +02:00
Artur Wieczorek
9f75d4e909 Make wxArrayStringProperty a parent of wxEditorDialogProperty
wxArrayStringProperty uses TextCtrlAndButton editor so it can be implemented as parent of wxEditorDialogProperty to re-use common functions and data.
2019-07-14 21:32:40 +02:00
Artur Wieczorek
a3ec84fdd1 Make wxFontProperty and wxMultiChoiceProperty parents of wxEditorDialogProperty
wxFontProperty and wxMultiChoiceProperty use TextCtrlAndButton editor so they can be implemented as parents of wxEditorDialogProperty to share common functions and data.
2019-07-14 21:30:00 +02:00
Artur Wieczorek
37f9c6f083 Implement wxEditorDialogProperty as a base class for wxPG properties with dialog editor
Properties using TextCtrlAndButton editor (like wxLongStringProperty, wxDirProperty, wxFileProperty) share some features, like button triggering the editor dialog, and share a data, like dialog window attributes, so for the sake of the clear design it would be good to derive them from the common base class in which all shared functions/data are implemented. This class is not intended to be instantiated so it's an abstract class.
2019-07-14 21:29:21 +02:00
Artur Wieczorek
050d608bcf Don't use export/visibility attributes in typedefs 2019-07-12 21:07:21 +02:00
Artur Wieczorek
ec56795572 Fix recursion in calling const getters
We have to explicitly call non-const getter to avoid recursive calls of the const getter.
2019-06-29 11:16:30 +02:00
Artur Wieczorek
d55cf1fc1f Fix marking wxPGIterator template class with dllexport/import attributes
It's not allowed to mark the class template. Only explicit instantiation can be marked with dllexport/import attributes.
2019-06-29 11:16:29 +02:00
Artur Wieczorek
d0a61a09ec Make validation helper functions private in all numeric wxPG properties
wxUIntProperty::DoValidation() is already declared as private and the same access level should be applied to DoValidation() in other numeric properties because these functions are helpers intended for internal use only.
2019-06-29 11:16:01 +02:00
Artur Wieczorek
48adc38bbb Refactor code for numeric validation in numeric wxPG properties
Move template function NumericValidation() to wxNumericProperty because all data necessary to validate the value are available here: acceptable value range, SpinCtrl editor value wrapping mode, etc.
2019-06-29 11:13:14 +02:00
Artur Wieczorek
69632371e3 Implement wxNumericProperty as a base class for all wxPG numeric properties
All numeric properties (wxIntProperty, wxUIntProperty, wxFloatProperty) share some features (like specific attributes, numeric validation, SpinCtrl editor support) so for the sake of clear design it would be good to derive them from the common base class (wxNumericProperty) in which all shared functions are implemented. This class is not intended to be instantiated so it's an abstract class.
2019-06-29 11:13:13 +02:00
Artur Wieczorek
8c0a210a75 Make wxPGProperty an abstract class
wxPGProperty is intended to be only a base class for property classes and therefore shouldn't be instantiated directly.
2019-06-29 11:11:35 +02:00
Artur Wieczorek
f4e37e57e4 Get rid of unnecessary const casts
A pointer to unqualified type are converted implicitly to a more cv-qualified type.
2019-06-16 19:50:57 +02:00
Artur Wieczorek
b064608c2a Use const_cast to change the constness 2019-06-16 19:50:08 +02:00
Artur Wieczorek
2ebdfb7a40 Remove obsoleted comments 2019-06-16 19:49:01 +02:00
Artur Wieczorek
efefc97aac Use template instead of macro to generate wxPropertyGridIterator class 2019-06-16 19:47:33 +02:00
Artur Wieczorek
98c1b057e8 Use standard wxVariant instead of wxPropertyGrid-specific WXVARIANT
There is no need to use WXVARIANT for data types directly supported by wxVariant.
2019-06-16 19:46:44 +02:00
Artur Wieczorek
d404ff02a1 Support tooltips in wxPropertyGrid if support for tooltips enabled is globally 2019-06-16 19:45:40 +02:00
Artur Wieczorek
6abf507923 Get rid of unused variables 2019-06-16 19:45:12 +02:00
Artur Wieczorek
a93713f7f8 Use long int literals to represent long constants 2019-05-26 18:51:37 +02:00
Artur Wieczorek
908342e3ad Code cleanup: Define wxPGProperty and wxPropertyGridPageState functions in their own class files
Having definitions of several wxPGProperty and wxPropertyGridPageState functions in wxPropertyGrid header is misleading so they should be moved to the files with their own classes definitions for the sake of clarity.
2019-05-26 18:12:31 +02:00
Artur Wieczorek
7a29f5dd2c Don't set maximum text length for non-text wxPG properties
Setting the limit for the length of the text the user can enter in the text editor makes sense only for properties having text editors so in wxPGProperty::SetMaxLength() should be done a check whether to actually set a limit or not depending on the kind of editor used.
wxPropertyGridInterface::SetPropertyMaxLength() should be implemented on top of wxPGProperty::SetMaxLength() to proceed only if maximum length was actually set.
2019-05-26 18:06:53 +02:00
Artur Wieczorek
549acf6e80 Implement wxPropertyGrid as wxScrolled
Scrolling operations and related calculations are simpler when wxPG is implemented as wxScrolled instead of wxScrollHelper.
2019-05-26 17:57:31 +02:00
Artur Wieczorek
04cebe381a Remove unneeded privileged access as friends 2019-05-12 20:24:59 +02:00
Artur Wieczorek
d4df8119ee Remove from documentation references to nonexistent classes 2019-05-12 20:24:58 +02:00
Artur Wieczorek
baaba42776 Refactor: display file selector dialog from within member function in wxFileProperty
By moving the code to display file selector dialog from wxPGFileDialogAdapter to wxFileProperty we can encapsulate the operation of showing the dialog because all required parameters are stored in the corresponding data members and there is no need to use call generic GetAttribute() function to retrieve them. This also helps in making wxFileProperty attributes built-ones in the future.
2019-05-12 20:24:55 +02:00
Artur Wieczorek
b2ea56b4e9 Make wxPG_FILE_DIALOG_STYLE a built-in attribute
This attribute is used only internally in wxFileProperty so it can be considered as a built-in attribute which value can be stored in the local data member and not in the property's attribute store.
2019-05-12 20:24:53 +02:00
Artur Wieczorek
9df9e32a70 Get rid of unnecessary casts to wxPGProperty*
These casts are unnecessary and can be removed.
2019-04-28 17:04:07 +02:00
Artur Wieczorek
50b1cfd0b5 Use dedicated function to change wxPGProperty flags
Using wxPGProperty::ChangeFlag() function makes the code simpler and more readable.
2019-04-28 16:38:48 +02:00
Artur Wieczorek
bd313b64ab Fix copying wxPGAttributeStorage
We need implement copy ctor and assignment operator because we are going to do a shallow copy of wxPGHashMapS2P data member and therefore we have to manually update reference counters of the objects being referenced in this map.
2019-04-28 16:35:11 +02:00