Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004393 [JEDI VCL] 00 JVCL Components major always 2008-07-04 13:44 2008-12-30 03:22
Reporter tetardd View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.32
Summary 0004393: Setting the Selected property of TJvTreeView does not trigger the OnSelectionChange event
Description If you set in code the Selected property to select a tree node, the OnSelectionChange event is not triggered.
Looking at the code, it seems that DoSelectionChange in not called in procedure CNNotify() in the TVN_SELCHANGEDA, TVN_SELCHANGEDW block of code.
Additional Information
Tags No tags attached.
Attached Files zip file icon TJvTreeView Bug [^] (8,230 bytes) 2008-11-05 13:25

- Relationships

-  Notes
obones (administrator)
2008-07-15 00:55

Please use the very latest version of the JVCL
Then, if the bug is still there, please provide the zipped sources of a sample application showing this.
tetardd (reporter)
2008-07-17 02:08


I checked the code for version 3.33 and 3.32 of TJvTreeView and there is no chnages in the code so the bug has not been fixed.
I fixed it myself by modification on the code below:

Procedure TJvTreeView.CNNotify(var Msg: TWMNotify);
          DoSelectionChange; // <- Corrects the OnSelectionChanged bug.
          if Assigned(FPageControl) then
               if Selected <> nil then

I also include a zip file of the application demonstrating the bug (and incidentally also the one in issue 004403):

Run the app (Project5.exe).
1- Select one tree view
2- Click the 'Change Selection in Code' button.

As expected, the label showing the selected item is correct and the memo that displayed triggered event is OK too.
Note that the selected item hasn't got its background drawn even if HideSelection is False (issue 004403).

3- Click again the 'Change Selection in Code' button.

No OnSelectionChange event has been triggered (as shown by memo lines).

4- Click the 'Add item and seelct it'.

A new item is added and selected and once again, no OnSelectionChanged is triggered.

I include an exe with my own fix (Project5 - Fixed.exe). Now, the events are properly triggered but some are done several times in a row so it is not a brilliant fixc.
tetardd (reporter)
2008-07-17 02:11

Having problems uploading demo of bug.
obones (administrator)
2008-07-17 02:34

Don't include the exe, we only want sources. With the exe, the zip file is too big anyway
obones (administrator)
2008-10-10 05:17

Hello, any news?
obones (administrator)
2008-12-30 03:22

This is now in SVN

- Issue History
Date Modified Username Field Change
2008-07-04 13:44 tetardd New Issue
2008-07-15 00:55 obones Note Added: 0014374
2008-07-15 00:55 obones Status new => feedback
2008-07-17 02:08 tetardd Note Added: 0014395
2008-07-17 02:11 tetardd Note Added: 0014396
2008-07-17 02:34 obones Note Added: 0014397
2008-10-10 05:17 obones Note Added: 0014826
2008-11-05 13:25 tetardd File Added: TJvTreeView Bug
2008-12-30 03:22 obones Note Added: 0015198
2008-12-30 03:22 obones Status feedback => resolved
2008-12-30 03:22 obones Fixed in Version => Daily / SVN
2008-12-30 03:22 obones Resolution open => fixed
2008-12-30 03:22 obones Assigned To => obones

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker