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 » Is it possible that the vista icon is used in CExtTabbedToolControlBarButtons? Collapse All
Subject Author Date
Seung Cheol Lee Aug 18, 2007 - 12:36 AM

I used 32 bits color bitmap to CExtTabbedToolControlBarButtons.
But CExtTabbedToolControlBarButtons was not applied alpha channel.
I didn’t know how to apply alpha channel to CExtTabbedToolControlBarButtons

================================================================================================================
g_nGroupCC_CountOfCommands =
stat_UpdateCommandProfileFromBitmapResource(
strCommandProfileName,
IDB_BITMAP_TOOLS_MEASURE1, <--- 32bits bitmap
g_nGroupCC_FirstCmdID
);
================================================================================================================
static void stat_AddBarIntoToolControlBar (CExtTabbedToolControlBar & _wndTabbedBar, LPCTSTR strToolBarName, UINT nFirstCmdID, UINT nCountOfCommands)
{
HWND hWnd = _wndTabbedBar.GetSafeHwnd();
ASSERT( hWnd != NULL && ::IsWindow(hWnd) );

LPCTSTR strCommandProfileName = g_CmdManager->ProfileNameFromWnd( hWnd );
ASSERT( strCommandProfileName != NULL && _tcslen(strCommandProfileName) > 0 );

CExtToolControlBar * pToolBar = _wndTabbedBar.BarInsert( strToolBarName );
ASSERT_VALID( pToolBar );

UINT nCommandIndex, nCmdID = nFirstCmdID;

for (nCommandIndex = 0; nCommandIndex < nCountOfCommands; nCommandIndex ++ ) {
pToolBar->InsertButton ( -1, nCmdID ++, FALSE );
}

pToolBar->InitContentExpandButton();
}
================================================================================================================

Technical Support Aug 20, 2007 - 5:25 AM

The CExtTabbedToolControlBar class is a control bar which contains one child tab page container window. The tab page container window is the parent of several CExtToolControlBar windows inserted into it as tab pages. The FunnyBars sample demonstrates how to use 32 bit BMP files with alpha channel as icon source for buttons in the CExtToolControlBar window. There is no difference between using 32-bit BMP files with alpha channel and any other BMP formats.

Please let us take a look at the stat_UpdateCommandProfileFromBitmapResource() function referred in your code. We guess you might load images in a not completely correct way. You can also send us your project so we can find out what may be wrong.

Seung Cheol Lee Aug 20, 2007 - 6:57 PM

I have tested on your the TabbedBars sample source.
I have changed the (24bit) tools_common_controls.bmp to (32bit with alpha channel) tools_common_controls.bmp.
But the CExtTabbedToolControlBarButtons was not applied as ever.

================================================================================================================
This is my code.
================================================================================================================
//================== Tabbed ToolBar ==================
    stat_UpdateCommandManager( m_hWnd );

    if (! m_wndTabbedBarButton.Create (_S(IDS_STRING20494), this, ID_VIEW_TABBEDBAR_WHIDBEY)) {
        TRACE0("Failed to create TabbedBarButton\n");
        return -1; // fail to create
    }
    stat_InitializeTabbedToolControlBar( m_wndTabbedBarButton );
    m_wndTabbedBarButton.GetTabPageContainer()->PageSelectionSet(0);
    
    m_wndTabbedBarButton.GetTabPageContainer()->PageVisibleSet(0, false);
    m_wndTabbedBarButton.GetTabPageContainer()->PageVisibleSet(1, false);
    m_wndTabbedBarButton.GetTabPageContainer()->PageVisibleSet(2, false);//const
    m_wndTabbedBarButton.GetTabPageContainer()->PageVisibleSet(3, false);

    m_wndTabbedBarButton.m_bHelperFlatTrackingCalcEnabledTab = true;
    m_wndTabbedBarButton.g_bToolbarScreenTips = true;
================================================================================================================
static void stat_UpdateCommandManager (HWND hWnd)
{    
    ASSERT( hWnd != NULL && ::IsWindow(hWnd) );

    LPCTSTR strCommandProfileName =    g_CmdManager->ProfileNameFromWnd( hWnd );
    ASSERT (strCommandProfileName != NULL && _tcslen(strCommandProfileName) > 0);

    g_nGroupCC_CountOfCommands =
        stat_UpdateCommandProfileFromBitmapResource(//기본형상 툴바 리소스 로드
            strCommandProfileName,
            IDB_BITMAP_TOOLS_MEASURE1,
            g_nGroupCC_FirstCmdID
            );
    g_nGroupCN_CountOfCommands =
        stat_UpdateCommandProfileFromBitmapResource(//확장형상 툴바 리소스 로드
            strCommandProfileName,
            IDB_BITMAP_PCS,
            g_nGroupCN_FirstCmdID
            );    
    g_nGroupMT_CountOfCommands =
        stat_UpdateCommandProfileFromBitmapResource (//관계 툴바 리소스 로드
            strCommandProfileName,            
            IDB_CONST_7200_TEST,
            g_nGroupMT_FirstCmdID
            );
    g_nGroupCM_CountOfCommands =
        stat_UpdateCommandProfileFromBitmapResource(
            strCommandProfileName,
            IDB_BITMAP_TOOLS_COMPONENTS,
            g_nGroupCM_FirstCmdID
            );
    g_nGroupPR_CountOfCommands =
        stat_UpdateCommandProfileFromBitmapResource(
            strCommandProfileName,
            IDB_BITMAP_TOOLS_PRINTING,
            g_nGroupPR_FirstCmdID
            );
    g_nGroupDL_CountOfCommands =
        stat_UpdateCommandProfileFromBitmapResource(
            strCommandProfileName,
            IDB_BITMAP_TOOLS_DIALOGS,
            g_nGroupDL_FirstCmdID
            );
}
================================================================================================================

Technical Support Aug 21, 2007 - 7:12 AM

Could you send us a modified version of the TabbedBars sample which tries to assign 32-bit with alpha images to tabbed toolbars unsuccessfully?