Onkeydown() event in CXTTreeBase |
Post Reply |
Author | |
abazosan
Newbie Joined: 24 May 2007 Status: Offline Points: 8 |
Post Options
Thanks(0)
Posted: 06 October 2008 at 11:27am |
Hi there,
I've got a CXTTree based class. I capture the OnKeyDown() event and it works fine.
When I navigate the tree with arrows up and down(even with SHIFT pressed), I capture the event, I get the list of selected items and refresh some information for all of them.
But, when I try to navigate the tree with the first letter of an item (pressing character 'c' to go to car...and so), list of selected items is empty so I can't do anything with it.
Is like the event launches after the selection of the next item with arrows, but before the selection of the next item with an alphanumeric character..
Is this a bug or am I doing something wrong?
This my code in OnKeyDown() method, if it helps
"void CMyClassView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { CXTTreeView::OnKeyDown(nChar, nRepCnt, nFlags);
tSetLong setSelectedTags;
long lFocusedTag= -1L;
CTreeCtrl &rTree= GetTreeCtrl(); CTypedPtrList<CPtrList, HTREEITEM> listItems;
GetSelectedList(listItems); POSITION pos= listItems.GetHeadPosition(); while (pos != NULL){ HTREEITEM hti= listItems.GetNext(pos); if (hti != NULL){ long lCode= rTree.GetItemData(hti);setSelectedItems.insert(lCode); HTREEITEM hti= GetFocusedItem(); TreeSelectionHasChanged(lFocusedTag); } }" |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
abazosan
Newbie Joined: 24 May 2007 Status: Offline Points: 8 |
Post Options
Thanks(0)
|
It worked well!
Thank you Oleg, you are very good.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |