Print Page | Close Window

Changing the Keyboardtip value for the 'File' tab

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=19334
Printed Date: 18 June 2025 at 3:22pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Changing the Keyboardtip value for the 'File' tab
Posted By: Enclaved Shadow
Subject: Changing the Keyboardtip value for the 'File' tab
Date 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:




Replies:
Posted By: Enclaved Shadow
Date 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?



Posted By: znakeeye
Date Posted: 22 December 2011 at 8:57am
I reported this long ago. Hope they listen this time :)

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



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