Print Page | Close Window

Onkeydown() event in CXTTreeBase

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=12345
Printed Date: 26 June 2024 at 1:06pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Onkeydown() event in CXTTreeBase
Posted By: abazosan
Subject: Onkeydown() event in CXTTreeBase
Date 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);

}

}"



Replies:
Posted By: Oleg
Date Posted: 07 October 2008 at 2:17am

Hi,


Think you need TVN_SELCHANGED notification. User can select item with mouse also...



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: abazosan
Date Posted: 21 October 2008 at 10:55am
It worked well!
 
Thank you Oleg, you are very good.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net