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 Tech Support » Update from V2.54 to V2.61 breaks existing applications Collapse All
Subject Author Date
Neville Franks Oct 23, 2006 - 2:40 AM

I’ve just upgraded fron V2.54 to 2.61 and all Toolbar and Menu Images are missing.

I had some other problems as you’ve changed the signature for CExtCustomizeSite::OnColorItemGenerateIcon() and CExtPopupMenuWnd::MENUITEMDATA::MeasureItem(). A conflict was also caused because it appears hat you noew include MFC’s occimpl.h I don’t think these issues are related to the missing images.

I can’t find any documentation about these API changes.

It isn’t good that updating to a new version of PROF-UIS breaks existing applications.

Neville Franks Oct 27, 2006 - 5:49 AM

I’ve just e-mailed a Zip file with two toolbars to support@prof-uis.com

Neville Franks Oct 25, 2006 - 2:39 PM

This is the code I’m using. Both functions use the same RGB(255,0,255) color.

    const COLORREF clrBmpTransparent = RGB(255,0,255);
VERIFY( g_CmdManager->UpdateFromToolBar( pszUIRegKey, ID_VIEW_STANDARD_BAR, NULL, NULL, FALSE, TRUE, clrBmpTransparent ) );

    if ( !m_wndToolBar.Create( NULL, this, ID_VIEW_STANDARD_BAR )
     || !m_wndToolBar.LoadToolBar( ID_VIEW_STANDARD_BAR, clrBmpTransparent )
     )
    {
     AMLOG_PERROR( "Failed to create main Toolbar." );
     return -1; // fail to create
    }

Technical Support Oct 27, 2006 - 5:40 AM

We have checked all issues with the transparent color and found nothing wrong. Could you send us the bitmap used in you toolbar resources?

Neville Franks Oct 23, 2006 - 6:43 PM

The problem with the missing images appears to be because I’m not using the default: clrBmpTransparent = RGB(192,192,192) color. My Toolbars use RGB(255,0,255). I have one Toolbar that does use the default RGB(192,192,192) and its images are displayed.

This seems like a bug to me and I’m very reluctant to change the background color of all of my toolbars as a work-around.

Neville, http://www.surfulater.com

Technical Support Oct 25, 2006 - 10:48 AM

We cannot confirm that there is a problem with this in the library. The most common way of adding icons to the command manager is be means of CExtCmdManager::UpdateFromToolBar() or CExtToolControlBar::LoadToolBar(). Both methods allow you to specify the transparent color and RGB(192,192,192) is the default parameter value. If you are using the first method with default transparent color and then invoking the second method with a custom color, the second method will fail to add images to the command manager. Please check this.

Neville Franks Oct 23, 2006 - 4:23 PM

I can’t see any errors in the Debugger in CExtCmdProfile::UpdateFromToolBar(). All functions return true and there are no ASSERT’s. My code uses VERIFY() on the calls to g_CmdManager->UpdateFromToolBar(). All Toolbars and Menu commands work, but no images are displayed anywhere, including in Prof-UIS Customize|Commands.

I don’t use any resource id’s in the range 29000...31000.

I call CExtPopupMenuWnd::MENUITEMDATA::MeasureItem() after using SetText() as follows:
_md.SetText( sMenuText );
_md.MeasureItem( NULL );

Are you saying this isn’t necessary?

I upgraded from 2.50 to 2.61, not from 2.54. Sorry about that.

Thanks for your help,
Neville

Technical Support Oct 25, 2006 - 10:37 AM

The CExtPopupMenuWnd::MENUITEMDATA::MeasureItem() now has a pointer to a paint manager in its parameter because the paint manager can affect menu item’s appearance and multiple paint managers can be used in scope of one application. You may not invoke this method if you construc the menu on-the-fly.

We answered the toolbar icon related issues in another message of this thread.

Technical Support Oct 23, 2006 - 10:47 AM

Here is the declaration of the CExtCustomizeSite::OnColorItemGenerateIcon() method both in 2.54 and in 2.61:

    virtual void OnColorItemGenerateIcon(
        CExtBarColorButton * pTBB,
        CExtCustomizeCmdTreeNode * pNode,
        COLORREF clr,
        CExtCmdIcon & icon
        );
Please open the VersionHistory page and find OnColorItemGenerateIcon. You can see that it was changed in 2.53. This and some other method signatures were changed in 2.53 due to new Windows OS independent bitmap alpha-blending capabilities introduced in Prof-UIS 2.53.

The CExtPopupMenuWnd::MENUITEMDATA::MeasureItem() method is internal and it is really rarely needed in customer applications.

As for the missing images in toolbars and menus: please let us which of them are missing (all or some of them)? The command manager based image collection is the same as in the first version of Prof-UIS. Would you step in the CExtCmdManager::UpdateFromToolBar() method in the debug mode and let us know if the toolbar resource is loaded successfully in the CExtCmdProfile::UpdateFromToolBar() method. Please also check your resource.h file and ensure there are any identifiers defined in the range of 29000...31000.