Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPTabControl ALT + prefix
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPTabControl ALT + prefix

 Post Reply Post Reply
Author
Message
sbinder View Drop Down
Groupie
Groupie
Avatar

Joined: 22 November 2004
Location: Austria
Status: Offline
Points: 76
Post Options Post Options   Thanks (0) Thanks(0)   Quote sbinder Quote  Post ReplyReply Direct Link To This Post Topic: CXTPTabControl ALT + prefix
    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?
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
sbinder View Drop Down
Groupie
Groupie
Avatar

Joined: 22 November 2004
Location: Austria
Status: Offline
Points: 76
Post Options Post Options   Thanks (0) Thanks(0)   Quote sbinder Quote  Post ReplyReply Direct Link To This Post 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. 
 
 
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
sbinder View Drop Down
Groupie
Groupie
Avatar

Joined: 22 November 2004
Location: Austria
Status: Offline
Points: 76
Post Options Post Options   Thanks (0) Thanks(0)   Quote sbinder Quote  Post ReplyReply Direct Link To This Post 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.
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.125 seconds.