Print Page | Close Window

mnemonics not work in tab control page

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=9094
Printed Date: 08 November 2025 at 1:44am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: mnemonics not work in tab control page
Posted By: joggx
Subject: mnemonics not work in tab control page
Date Posted: 13 December 2007 at 1:37pm
I use CXTPTabControl on a formview then the page's  mnemonics do not work any more. Also the tab key doesn't work either.

How can it make it work like in a normal dialog?

Many thanks

Timmy



Replies:
Posted By: Oleg
Date Posted: 14 December 2007 at 2:50pm

Think you can catch PreTranslateMessage and manually set page.

 
form our code:
 
BOOL CXTPCustomizeSheet::PreTranslateMessage(MSG* pMsg)
{
 if (pMsg->message == WM_SYSKEYDOWN)
 {
  CTabCtrl* pTabCtrl = GetTabControl();
  if (pTabCtrl)
  {
   for (int i = 0; i < pTabCtrl->GetItemCount(); i++)
   {
    TCHAR lpCaption[256];
    lpCaption[0] = _T('\0');
    TCITEM tcItem;
    tcItem.mask = TCIF_TEXT;
    tcItem.pszText = lpCaption;
    tcItem.cchTextMax = 256;
    if (pTabCtrl->GetItem(i, &tcItem))
    {
     TCHAR* pAmp = _tcsrchr(lpCaption, _T('&'));
     if (pAmp)
     {
      if (CXTPShortcutManager::CompareAccelKey(*(pAmp + 1), (TCHAR)pMsg->wParam))
      {
       SetActivePage(i);
       return TRUE;
      }
     }
    }
   }
  }
 }
 return  CPropertySheet::PreTranslateMessage(pMsg);
}


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


Posted By: joggx
Date Posted: 14 December 2007 at 11:32pm
Thanks. But my problem is the ampersands inside the property pages are not working. Here is the hierarchy of UI classes:

CPropertyPage -> CXTPTabControl -> CXTResizeFormView

Plus the tab key, which is used to navigate through the controls in a page, becomes unusable. The Ctrl+Tab is unable to switch between different property pages too.

Thanks.




Posted By: Oleg
Date Posted: 15 December 2007 at 12:12pm
You use TabControl instead of Tabs for PropertyPages???
 
Try our CXTPPropertySheet from last releases.


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


Posted By: joggx
Date Posted: 15 December 2007 at 2:12pm
we need to add our own buttons at the bottom, can CXTPPropertySheet do that? 


Posted By: Oleg
Date Posted: 16 December 2007 at 11:53am
Yes, in OnCreate call AddButton(nIDCaption, nID)


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


Posted By: joggx
Date Posted: 18 December 2007 at 2:27pm
Is there any sample code demonstrating the CXTPPropertySheet in codejock?


Posted By: Oleg
Date Posted: 18 December 2007 at 3:36pm
Samples\Controls\PropertySheet

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



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