BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

strange OnEdited behavior when MultiSelect is true

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Third Party Tools)
View previous topic :: View next topic  
Author Message
Muzaffar Mahkamov
Guest





PostPosted: Thu Sep 29, 2005 5:41 am    Post subject: strange OnEdited behavior when MultiSelect is true Reply with quote



I apologize beforehand if this is not the right place to ask.

I have a problem when handling TTntListView's OnEdited event when
multiselect and ownerdraw are true. The event receives a wrong TTntListItem.

Steps to reproduce:

1. Drop a TTntListView component on a form
2. Set MultiSelect to true
3. Set RowSelect to true
4. Set OwnerData to true
5. Add some items to the list view (through OnData event)
6. Enter the editing mode on Item1
7. Enter some text, do not press Enter or lose focus
8. While Item1 is in edit mode select Item2. Item2 will be renamed
instead of Item1. OnEdited event handler will receive Item2 as "Item"
argument, not Item1.

With native VCL TListView component everything is fine.

Now another trick (more strange)
1. Declare TTntListItem as your TForm's private member as FSavedItem
2. Handle the OnEditing event and save the reference to "Item" argument
(the one being edited) in FSavedItem.
3. Enter the editing mode on Item1 (reference to Item1 will be saved in
FSavedItem)
4. Enter some text, do not press Enter or lose focus
5. Set breakpoint in OnEdited handler to check FSavedItem
6. While Item1 is in edit mode select Item2. The debugger will stop at
the breakpoint. Check the FSavedItem - it refers to Item2, not Item1!


The one below is a rare bug but might give some clue:
1. Add some items to the list view (through OnData event)
2. Enter the editing mode on Item1
3. Enter some text, do not press Enter or lose focus
4. While Item1 is in edit mode move mouse cursor over Item2
5. While mouse cursor is over Item2 press Enter to finish editing Item1.
Item2 will be renamed instead of Item1. OnEdited event handler will
receive Item2 as "Item" argument, not Item1.


System info:
Borland C++ Builder 6 Enterprise, Update 4
Windows XP SP2
TNT Unicode components 2.1.17
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Third Party Tools) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.