Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Changing the Keyboardtip value for the 'File' tab
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Changing the Keyboardtip value for the 'File' tab

 Post Reply Post Reply
Author
Message
Enclaved Shadow View Drop Down
Groupie
Groupie
Avatar

Joined: 22 August 2006
Location: Canada
Status: Offline
Points: 31
Post Options Post Options   Thanks (0) Thanks(0)   Quote Enclaved Shadow Quote  Post ReplyReply Direct Link To This Post Topic: Changing the Keyboardtip value for the 'File' tab
    Posted: 20 December 2011 at 2:53pm
Is there a way to manually change the Keyboardtip value for the 'File' tab?  Due to international localization issues we have had to manually specify the keyboard tips for every control on our Ribbon.  I have been able to do this for all controls except for the 'File' tab.  Below is some code I have tried but none of it works.

CXTPControlPopup* opControlFile = (CXTPControlPopup*)m_opRibbonBar->AddSystemButton(ID);
opControlFile->SetKeyboardTip(_T("Z1"));

CXTPRibbonControlTab* opCtrlTab = m_opRibbonBar->GetControlTab();
opCtrlTab->SetKeyboardTip(_T("Z2"));

CXTPRibbonControlSystemButton* opSystemButton = m_opRibbonBar->GetSystemButton();
opSystemButton->SetKeyboardTip(_T("Z3"));

It seems no matter what I do the 'File' tab always uses the default generated value as seen below:

Back to Top
Enclaved Shadow View Drop Down
Groupie
Groupie
Avatar

Joined: 22 August 2006
Location: Canada
Status: Offline
Points: 31
Post Options Post Options   Thanks (0) Thanks(0)   Quote Enclaved Shadow Quote  Post ReplyReply Direct Link To This Post Posted: 21 December 2011 at 10:12am
I have found the source of the problem.  We are using ToolkitPro 15.0.2 and in the file XTPRibbonBar.cpp there is a method called 'void CXTPRibbonBar::CreateKeyboardTips()'.  The following is a small code snippet from that method:
if (m_pControlSystemButton)
{
    CPoint pt(m_pControlSystemButton->GetRect().CenterPoint().x, m_pControlSystemButton->GetRect().CenterPoint().y);

    CXTPCommandBarKeyboardTip* pWnd = new CXTPCommandBarKeyboardTip(pCommandBars,
        m_pControlSystemButton, m_pControlSystemButton->GetCaption(), pt, DT_VCENTER | DT_CENTER, m_pControlSystemButton->GetEnabled());

    pCommandBars->m_keyboardTips.arr.Add(pWnd);

}

In the above code the assigned keyboard tip is ignored.  The code posted below should resolve the situation:
if (m_pControlSystemButton)
{
    CPoint pt(m_pControlSystemButton->GetRect().CenterPoint().x, m_pControlSystemButton->GetRect().CenterPoint().y);

    CXTPCommandBarKeyboardTip* pWnd = new CXTPCommandBarKeyboardTip(pCommandBars,
        m_pControlSystemButton, m_pControlSystemButton->GetCaption(), pt, DT_VCENTER | DT_CENTER, m_pControlSystemButton->GetEnabled());

    if (!m_pControlSystemButton->GetKeyboardTip().IsEmpty())
    {
        pWnd->m_strTip = m_pControlSystemButton->GetKeyboardTip();
    }


    pCommandBars->m_keyboardTips.arr.Add(pWnd);
}

This is actually a big problem for us and it is a little too close to our release date to update our version of Codejock so we are going to have to modify the source and rebuild everything.  Would it be possible to have this fix added to the next update/patch of ToolkitPro?

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: 22 December 2011 at 8:57am
I reported this long ago. Hope they listen this time :)
PokerMemento - http://www.pokermemento.com/
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.047 seconds.