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.
This commit is contained in:
@@ -1577,7 +1577,14 @@ public:
|
||||
*/
|
||||
wxPGProperty* GetMainParent() const;
|
||||
|
||||
/** Returns maximum allowed length of property's text value.
|
||||
/**
|
||||
Returns maximum allowed length of the text the user can enter in
|
||||
the property text editor.
|
||||
|
||||
@remarks
|
||||
0 is returned if length is not explicitly limited and the text can be
|
||||
as long as it is supported by the underlying native text control
|
||||
widget.
|
||||
*/
|
||||
int GetMaxLength() const;
|
||||
|
||||
@@ -1932,7 +1939,12 @@ public:
|
||||
void SetLabel( const wxString& label );
|
||||
|
||||
/**
|
||||
Set max length of text in text editor.
|
||||
Set maximum length of the text the user can enter in the text editor.
|
||||
If it is 0, the length is not limited and the text can be as long as
|
||||
it is supported by the underlying native text control widget.
|
||||
|
||||
@return
|
||||
Returns @true if maximum length was set.
|
||||
*/
|
||||
bool SetMaxLength( int maxLen );
|
||||
|
||||
|
Reference in New Issue
Block a user