Print Page | Close Window

Shortcuts in Menus inside dialogs

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=2546
Printed Date: 06 October 2024 at 2:04am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Shortcuts in Menus inside dialogs
Posted By: Uwe Keim
Subject: Shortcuts in Menus inside dialogs
Date Posted: 08 July 2005 at 2:27am

Dear support, maybe you can help me:

I derived and replaced CXTPShortcutManager in order to implement the automatic drawing of shortcut-texts in menus inside dialogs.

Unfortunately the function CXTPPopupBar::UpdateShortcuts which actually calls the shortcut manager starts with:

void CXTPPopupBar::UpdateShortcuts()
{
    if (GetFrameSite() == NULL)
        return;
    ...

This GetFrameSite returns NULL, because I am inside a dialog, not inside a frame window.

Question: Is there a workaround/other solution for this?

I came that far, I would really be disappointed if I must end here....

Thanks
Uwe




Replies:
Posted By: Oleg
Date Posted: 08 July 2005 at 5:50am

Last version (9.70) of CXTPPopupBar::UpdateShortcuts look like:

void CXTPPopupBar::UpdateShortcuts()
{
 CXTPCommandBars* pCommandBars = GetCommandBars();
 if (!pCommandBars)
  return;

 if (!pCommandBars->GetCommandBarsOptions()->bAutoUpdateSh ortcuts)
  return;

 foreach (pControl, TRUE)
 {
  CString strShortcut;
  if (pControl->GetID() != 0)
  {
   XTPShortcutManager()->FindDefaultAccele rator(pControl->GetID(), strShortcut, pCommandBars);
   pControl->m_strShortcutTextAuto = strShortcut;
  }
 }
}



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


Posted By: Uwe Keim
Date Posted: 08 July 2005 at 7:43am

Cool, thank you!  

I will download immediately.



Posted By: Uwe Keim
Date Posted: 08 July 2005 at 9:39am

OK, now I upgraded, but the GetCommandBars() function at the top of:

void CXTPPopupBar::UpdateShortcuts()
{
 CXTPCommandBars* pCommandBars = GetCommandBars();
 if (!pCommandBars)
  return;
  ...

Always returns a NULL pointer inside my dialog-hosted menu bar.

Question: Any chance of getting the shortcut-manager called inside a dialog?

Of course I'm continuing to research, but maybe you still can help.

Thanks
Uwe




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