Print Page | Close Window

CXTPTabControl ALT + prefix

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=13673
Printed Date: 23 June 2025 at 1:01am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPTabControl ALT + prefix
Posted By: sbinder
Subject: CXTPTabControl ALT + prefix
Date Posted: 13 March 2009 at 7:34am
I am using CXTPTabControl and I want to use hotkeys with ALT + prefix. I set the members
tabControl.GetPaintManager()->m_bDrawTextNoPrefix = FALSE;
tabControl.GetPaintManager()->m_bDrawTextHidePrefix = FALSE;
and I gave the Control the Style WS_EX_CONTROLPARENT.
When I type for example ALT+S for "System"-Tab nothing happens, but when the Tab is already selected
the CXTPPropertyGrid - which is bind to the TAB - is focused.
And is it possible to use Control + TAB to switch the TABS like in CTabCtrl or CXTTabCtrl?



Replies:
Posted By: znakeeye
Date Posted: 13 March 2009 at 7:55am
I suppose you need to make your own OnCmdMsg()-handler.
 
CMainFrame::OnCmdMsg(...)
{
     if (m_tabControl.GetSafeHwnd())
     {
           if (m_tabControl.OnCmdMsg(...))
                return TRUE;
     }
    
     return CFrameWnd::OnCmdMsg(...);
}
 
Something like that is needed to get ALT-shortcuts working in your panes/tabs etc.


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: sbinder
Date Posted: 13 March 2009 at 8:22am
Hallo!
Thanks for the quick reply. I did what you told my in my modal dialog, but it doesn't work. 
 
 


Posted By: znakeeye
Date Posted: 13 March 2009 at 9:08am
Not sure how dialogs do this, but you could try something like this...
 
CYourDlg::OnCmdMsg(...)
{
     if (::GetFocus() == m_tabControl.GetSafeHwnd())
     {
           if (m_tabControl.OnCmdMsg(...))
                return TRUE;
     }
    
     return CDialog::OnCmdMsg(...);
}
 
Also, read about IsDialogMessage(). That's the function responsible for ALT-translations.


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: sbinder
Date Posted: 13 March 2009 at 9:26am

If I type ALT + prefix from the TabControl (for Example ALT + S for TAB"System") the OnCmdMsg will not be called!

If I type ALT + A for my Button (outside the TabControl - in my CDialog) "Abbruch" OnCmdMsg will be called
and the CDialog close as it have to do.



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