Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - BUG?: CXTTreeCtrl beeps when pressing VK_RETURN
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

BUG?: CXTTreeCtrl beeps when pressing VK_RETURN

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: BUG?: CXTTreeCtrl beeps when pressing VK_RETURN
    Posted: 25 November 2008 at 10:05am
Hi;
This can be seen in toolkit TreeCtrl sample too:

When pressing the ENTER key (VK_RETURN) while a parent node is selected, the expansion state changes, but also a system beep occures (not handled SYSKEYS; e.g. accelerators lead to system sounds)!

I think that CXTTreeBase::PreTranslateMessage() should be changed as shown below (Oleg, could you apply this?):

BOOL CXTTreeBase::PreTranslateMessage(MSG* pMsg)
{
    if (pMsg->message == WM_KEYDOWN)
    {
        // ensure that keystrokes are handled by the edit control.
        if (HasEditLabels() && m_pTreeCtrl->GetEditControl())
        {
            ::TranslateMessage(pMsg);
            ::DispatchMessage(pMsg);

            return TRUE;
        }

        // toggle expand / contract when return key is hit.
        if (pMsg->wParam == VK_RETURN)
        {
            HTREEITEM htItem = m_pTreeCtrl->GetSelectedItem();
            if (htItem != NULL)
            {
                m_pTreeCtrl->Expand(htItem, TVE_TOGGLE);
                return TRUE;
            }
        }
    }

    return m_pTreeCtrl->CTreeCtrl::PreTranslateMessage(pMsg);
}


I'm using toolkit version 12.0.1, VC++ 7.1...

Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 26 November 2008 at 3:13am
Hi,
 
Thanks. changed.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Alex H. View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 February 2004
Status: Offline
Points: 266
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alex H. Quote  Post ReplyReply Direct Link To This Post Posted: 31 March 2009 at 7:18am
< ="Content-" content="text/; charset=utf-8">< name="ProgId" content="Word.">< name="Generator" content="Microsoft Word 12">< name="Originator" content="Microsoft Word 12"><>

This adoptions leads to a changed behaviour and breaks existing code for handling VK_ENTER in any TVN_KEYDOWN handler by the application! TVN_KEYDOWN now is not triggered anymore for VK_ENTER as it's eaten up by this change.

 

Any suggestions?

 

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2009 at 1:11am
Hello,
 
Please override CXTTreeCtrl/View override PreTranslateMessage and call CWnd::PreTranslateMessage.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
XPOHuK View Drop Down
Newbie
Newbie


Joined: 19 March 2009
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote XPOHuK Quote  Post ReplyReply Direct Link To This Post Posted: 23 April 2009 at 5:04am
Note, that TVN_ITEMEXPANDING notification is not sent when expanding or collapsing using Enter key.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.