Opened 9 months ago

Closed 8 months ago

#15778 closed defect (fixed)

wxTextValidator::SetIncludes inappropriately prohibits all the user input.

Reported by: jbbbms Owned by:
Priority: normal Milestone: 3.0.1
Component: base Version: 3.0.0
Keywords: wxTextValidator, SetIncludes Cc:
Blocked By: Blocking:
Patch: no

Description

After executing wxTextValidator object's method SetIncludes, the user can't input anything on the associated window, unless he pastes text from the clipboard. This happens in wxGTK and wxMSW. On the other hand, method SetExcludes has no this suspected flaw.

If the pasted contents conform to the string array specified by wxTextValidator::SetIncludes, the dialog will close normally. If not, the dialog will show an error message (as it shall) and don't close. The attached file is the demo.

Maybe wxTextValidator::SetIncludes is supporsed to behave like a counterpart of wxTextValidator::SetExcludes, which checks the user input only when the dialog is closing.

Attachments (1)

buggy.cpp download (757 bytes) - added by jbbbms 9 months ago.
a demo of wxTextValidator::SetIncludes's possible flaw

Download all attachments as: .zip

Change History (4)

Changed 9 months ago by jbbbms

a demo of wxTextValidator::SetIncludes's possible flaw

comment:1 Changed 9 months ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [75449]) Make wxFILTER_INCLUDE_LIST in wxTextValidator actually usable.

Only check for its violation once the full text is entered as otherwise
nothing could ever be entered when it was used.

Closes #15778.

comment:2 Changed 9 months ago by vadz

  • Milestone set to 3.0.1
  • Resolution changed from fixed to port to stable
  • Status changed from closed to portneeded

This could be backported to 3.0.x if no problems are found.

comment:3 Changed 8 months ago by VZ

  • Resolution changed from port to stable to fixed
  • Status changed from portneeded to closed

(In [75768]) Make wxFILTER_INCLUDE_LIST in wxTextValidator actually usable.

Only check for its violation once the full text is entered as otherwise
nothing could ever be entered when it was used.

Closes #15778.

Note: See TracTickets for help on using tickets.