#18351 closed defect (fixed)

A property is no longer marked as invalid if wxPropertyGrid loses focus.

Reported by: Dummy Owned by: Artur Wieczorek <artwik@…>
Priority: normal Milestone:
Component: wxPropertyGrid Version: 3.1.2
Keywords: validation Cc: aliket1435@…
Blocked By: Blocking:
Patch: no

Description

I am using a wxPropertyGrid in a modal dialog. This propgrid includes properties based on wxStringProperty, which uses virtual bool wxPGProperty::ValidateValue(...) to validate the user input.
If the user enters an invalid entry and clicks immediately after that on the OK button to close the dialog, without pressing Enter or clicking into another property to confirm the new entry first, the property is not marked as invalid.
The error message is displayed, but without marking the property.

The problem can be also reproduced with the propgrid sample:

  1. Clear the value of wxIntProperty named Y, in category "Position" on the default start page "Standard Items".
  2. Click on button "Show Popup", so that wxPropertyGrid loses the focus. -> An error message will be shown without marking the property.


In wxWidgets-3.1.0 that still worked.


Attachments (3)

wxPropGridValidation_wx312.png download (8.0 KB) - added by Dummy 17 months ago.
wxPropGridValidation_wx310.png download (8.3 KB) - added by Dummy 17 months ago.
propgrid_validation.png download (63.3 KB) - added by AliKet 17 months ago.

Download all attachments as: .zip

Change History (6)

Changed 17 months ago by Dummy

Changed 17 months ago by Dummy

Changed 17 months ago by AliKet

comment:1 Changed 17 months ago by AliKet

  • Cc aliket1435@… added

Works corrctly for me (Ubuntu 18.04 and wxWidgets git source)

comment:2 Changed 17 months ago by Dummy

You are right, on Linux it works.

So it seems to be a Windows specific issue.
I am using wxMSW-3.1.2 on Windows 10.

comment:3 Changed 17 months ago by Artur Wieczorek <artwik@…>

  • Owner set to Artur Wieczorek <artwik@…>
  • Resolution set to fixed
  • Status changed from new to closed

In 47bba876/git-wxWidgets:

Fix drawing invalid wxPGProperty

Invalid wxPGProperty needs to be redrawn after setting wxPG_FL_CELL_OVERRIDES_SEL because this flag
is used to select proper colors to mark property as invalid.
This order of operations is important under e.g. wxMSW when redrawing with DrawItemAndChildren() is done immediately.

Closes #18351.

Note: See TracTickets for help on using tickets.