View Issue Details

IDProjectCategoryView StatusLast Update
0027955LazarusLCLpublic2015-04-26 23:20
ReporterJonas MaebeAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformMac OS XOSOS XOS Version10.9.5
Product Version1.4Product Build 
Target Version1.6Fixed in Version1.5 (SVN) 
Summary0027955: TStringGrid.Onvalidate does not work correctly if the field was edited by directly typing new content
DescriptionIf a cell in a stringgrid is selected and you just start typing content without first pressing return or double clicking the cell, the onvalidate handler gets the old value in both the OldValue and NewValue parameters.
Steps To Reproducea) compile and run the provided project
b) if none of the cells in the stringgrid is selected, click on one (once)
c) type any text, e.g.: a
d) press return
e) the message will show that the onvalidate handler was called with the empty string as both the old and the new value
f) if you type a new value in the same cell (reselecting it using the arrow keys) without activating the editor first via double-clicking or pressing return, you will get the previously entered value again as both old and new value
g) you you do press "return" or double click on a cell before entering a new value, then the correct values will be passed to onvalidate once you finish editing
Additional InformationThe reason there are two columns with a different kind of editor is because before I discovered when exactly the problem occurred, I thought it only happened in with picklist cell editors. That's however not the case, it seems to be independent of the kind of editor.
TagsNo tags attached.
Fixed in Revision48872
LazTarget1.6
WidgetsetCarbon
Attached Files

Activities

Jonas Maebe

2015-04-24 13:46

reporter   ~0083154

Extra condition: it only goes wrong if you enter only a single character. If you enter more than one character in the cell, the NewValue parameter of the OnValidate handler is also correct.

Jonas Maebe

2015-04-24 14:00

reporter  

onvalidate.zip (2,336 bytes)

Jonas Maebe

2015-04-24 16:12

manager   ~0083158

This also happens under Linux/Qt, so it seems platform-independent.

Jesus Reyes

2015-04-26 22:37

developer   ~0083248

Please test.

Jonas Maebe

2015-04-26 23:20

reporter   ~0083251

Fix confirmed, thanks!

Issue History

Date Modified Username Field Change
2015-04-24 13:44 Jonas Maebe New Issue
2015-04-24 13:46 Jonas Maebe Note Added: 0083154
2015-04-24 14:00 Jonas Maebe File Added: onvalidate.zip
2015-04-24 16:12 Jonas Maebe Note Added: 0083158
2015-04-24 17:00 Jesus Reyes Assigned To => Jesus Reyes
2015-04-24 17:00 Jesus Reyes Status new => assigned
2015-04-26 22:37 Jesus Reyes Fixed in Revision => 48871
2015-04-26 22:37 Jesus Reyes LazTarget => 1.6
2015-04-26 22:37 Jesus Reyes Note Added: 0083248
2015-04-26 22:37 Jesus Reyes Status assigned => resolved
2015-04-26 22:37 Jesus Reyes Fixed in Version => 1.5 (SVN)
2015-04-26 22:37 Jesus Reyes Resolution open => fixed
2015-04-26 22:37 Jesus Reyes Target Version => 1.6
2015-04-26 22:43 Jesus Reyes Fixed in Revision 48871 => 48872
2015-04-26 23:20 Jonas Maebe Note Added: 0083251
2015-04-26 23:20 Jonas Maebe Status resolved => closed