Commit Graph

433 Commits

Author SHA1 Message Date
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
Artur Wieczorek
f39e70be15 Use dedicated event type to notify header about column width changes
Notification about changes of column widths needs to be sent locally from wxPropertyGrid to  wxPropertyGridManager (to update the header) so it would be good to use a dedicated non-public event type for these purposes.
2019-04-28 15:31:10 +02:00
Artur Wieczorek
cd1dafb619 Make wxPG_ATTR_MULTICHOICE_USERSTRINGMODE a built-in attribute
This attribute is used only internally in wxArrayStringProperty and thus 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-04-22 20:16:15 +02:00
Artur Wieczorek
b35170dc61 Make wxPG_BOOL_USE_CHECKBOX and wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING built-in attributes
Both attributes are used only in wxBoolProperty and wxFlagsProperty to set respective internal flags and don't have to be stored in the property's attribute store.
2019-04-21 23:39:32 +02:00
Artur Wieczorek
ccd877c458 Make wxPG_FLOAT_PRECISION a built-in wxFloatProperty attribute
wxPG_FLOAT_PRECISION value is used only internally in wxFloatProperty and there is no need to make it readable via getter function.
2019-04-21 23:39:30 +02:00
Paul Cornett
af1cf0a5f3 Use ctor-initializer rather than assignment for non-POD class members 2019-04-05 10:21:04 -07:00
Paul Cornett
365759753a Pass parameters by const reference rather than by value 2019-04-05 09:18:07 -07:00
Artur Wieczorek
86af7d5ee9 Get rid of unnecessary overriding function
OnValidationFailure() in derived class wxEnumProperty has the same implementation (empty body) as the implementation in the base class wxPGProperty so overriding this function in derived class is not necessary.
2019-03-09 18:57:56 +01:00
Paul Cornett
7c3ce912e0 Use ctor-initializer rather than assignment for non-POD class members 2019-02-25 10:23:35 -08:00
Paul Cornett
c41ff4e694 Remove unuseable wxPGArrayEditorDialog ctor
It calls Create(), which calls the pure virtual ArrayGetCount(), which will
crash, as the required override can't be called from the base class ctor.
2019-02-17 18:00:26 -08:00
Artur Wieczorek
a005391413 Use wxEventType instead of int
This parameter identifies the type of the event so it should be of type wxEventType.
2019-01-11 19:22:50 +01:00
Artur Wieczorek
daf33b9b41 Use Boolean variable to store Boolean values 2019-01-11 19:22:49 +01:00
Artur Wieczorek
1f739e5f82 Get rid of unused member variable 2019-01-11 19:22:48 +01:00
Artur Wieczorek
d47413697b Use wxVector<wxWindow*> instead of wxArrayPtrVoid 2019-01-11 19:22:48 +01:00
Artur Wieczorek
8f8955b2b9 Use wxVector<wxObject*> instead of wxArrayPGObject 2019-01-11 19:22:47 +01:00
Artur Wieczorek
eb40eb4b84 Fix horizontal scrolling of wxPropertyGrid header
wxPropertyGridHeader associated with wxPropertyGrid has to be notified about every horizontal scroll of the grid.
New position is sent with dedicated wxEVT_PG_HSCROLL event being handled by wxPropertyGridManager which in turn scrolls the header accordingly.

See #18313.
2019-01-11 19:22:34 +01:00