Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Problems with StatusBar tooltips (2.21Trial) Collapse All
Subject Author Date
Attila Jun 19, 2003 - 5:59 PM

Hello!

I’d like to modify the status bar tooltips dinamically (not from resource), but they
won’t be appear there... (the little menu tooltips (CExtPopupMenuTipWnd) are working fine)

Here is my last try:
g_CmdManager->UpdateFromMenu(__PROF_UIS_PROJECT_CMD_PROFILE_NAME, IDR_MAINFRAME;
CExtCmdManager::cmd_t *pCmd=g_CmdManager->CmdGetPtr(__PROF_UIS_PROJECT_CMD_PROFILE_NAME, IDD_SOMETHING);
if (pCmd!=NULL)
{
pCmd->m_sMenuText="Menu text";
pCmd->m_sToolbarText="Toolbar Text";
pCmd->m_sTipTool="Short tooltip";
pCmd->m_sTipStatus="Long tooltip";
g_CmdManager->CmdSetup(__PROF_UIS_PROJECT_CMD_PROFILE_NAME, *pCmd, true);
}
m_wndMenuBar.UpdateMenuBar();

Best Regards,
P. Attila

Sergiy Lavrynenko Jun 24, 2003 - 2:56 AM

Hi,

Thank you for your interest and the good question.

I have found the cause of the problem. The MFC’s status bar message updating is based on the MFC’s internal WM_SETMESSAGESTRING message with wParam equal to resource ID of a text string. So CStatusBar always reloads a new text string from the resource string table. I have changed the status bar message updating alogorithm in Prof-UIS. Now the status bar displays messages from the command manager.

I can send you updated code via e-mail. Just drop me a letter and I will reply with an attached ZIP file.

Regards, Sergiy.

Sergiy Lavrynenko Jun 19, 2003 - 11:24 PM

Hi,

The code in your message registers new command IDD_SOMETHING. The g_CmdManager->CmdSetup() should be used if IDD_SOMETHING is not present in the IDR_MAINFRAME menu. Invoke of UpdateMenuBar() is not needed. Now you can use IDD_SOMETHING in the dynamically constucted menus and toolbars.

If you need to change status tip of IDD_SOMETHING on-the-fly (when it is already registered), you should get the pointer to the command description and modify m_sTipStatus.

    g_CmdManager->CmdGetPtr (
        __PROF_UIS_PROJECT_CMD_PROFILE_NAME,
        IDD_SOMETHING
        ) -> m_sTipStatus = "NEW LONG TOOLTIP TEXT";


Regards, Sergiy.

Attila Jun 21, 2003 - 1:18 PM

Theoretically yes.... I agree with you.
But I’d tied and it does not working. The statusbar tooltips still comes from the menu’s resource texts, just the CExtPopupMenuTipWnd texts are changing.

A bug maybe?

(The IDD_SOMETHING is already presented in the menu, I had used the CmdSetup() and the UpdateMenuBar() just because the ..CmdGetPtr(..)->m_sTipStatus=".."; was not enough in itself...)


Regards, Attila.