|
|
|
|
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.
Subject |
Author |
Date |
|
Fietiger Kisinger
|
Nov 27, 2008 - 10:18 PM
|
In my project I want to use CExtTabbedToolControlBarOneNote to keep my command buttons which should have been kept in toolbars.And I have specified icon for every button in toolbar resources but I did not specifed none toolbar to keep the icons of the buttons.The problem is that the icons did not display in my CExtTabbedToolControlBarOneNote. The button area responded normally.So What should I do to display the icons in the CExtTabbedToolControlBarOneNote? Thank you!
|
|
Fietiger Kisinger
|
Nov 28, 2008 - 7:12 PM
|
Yes.I have created my project with Profuis Appwizard. So the g_CmdManager->ProfileSetup() code is invoked in CXTreeCtrlApp::SetupUiAdvancedOptions().The problem is still If I use CExtToolControlBar::InsertButton() like this: HWND hWnd = m_wndTabbedBarOneNote.GetSafeHwnd();
ASSERT( hWnd != NULL && ::IsWindow(hWnd) );
// LPCTSTR strCommandProfileName =
// g_CmdManager->ProfileNameFromWnd( hWnd );
// ASSERT( strCommandProfileName != NULL && _tcslen(strCommandProfileName) > 0 );
CExtToolControlBar * pToolBar = m_wndTabbedBarOneNote.BarInsert( "View" );
ASSERT_VALID( pToolBar );
pToolBar->InsertButton( -1, ID_VIEW_TOOLBAR, TRUE );//The button did not show up
pToolBar->InsertButton( -1, ID_VIEW_MENUBAR, TRUE );//The button did not show up
pToolBar->InitContentExpandButton(); But I have find another way to solve the problem,that is CExtToolControlBar::LoadToolBar(). HWND hWnd = m_wndTabbedBarOneNote.GetSafeHwnd();
ASSERT( hWnd != NULL && ::IsWindow(hWnd) );
// LPCTSTR strCommandProfileName =
// g_CmdManager->ProfileNameFromWnd( hWnd );
// ASSERT( strCommandProfileName != NULL && _tcslen(strCommandProfileName) > 0 );
CExtToolControlBar * pToolBar = m_wndTabbedBarOneNote.BarInsert( "Main" );
ASSERT_VALID( pToolBar );
// pToolBar->InsertButton( -1, ID_FILE_NEW, TRUE );
pToolBar->LoadToolBar( IDR_MAINFRAME );// The whole toolbar displayed.
|
|
Technical Support
|
Dec 1, 2008 - 10:18 AM
|
You are inserting two toolbar buttons ID_VIEW_TOOLBAR and ID_VIEW_MENUBAR . Please ensure these command identifier are registered in the command manager. They can be registered automatically if the command manager is updated from some toolbar resource where these identifiers are used as button identifiers. You can allocate them manually using the CExtCmdManager::CmdAllocPtr() method and then assign their icons using the CExtCmdManager::CmdSetIcon() method.
|
|
Fietiger Kisinger
|
Dec 2, 2008 - 5:54 PM
|
|
|
Technical Support
|
Nov 28, 2008 - 12:49 PM
|
It seems you may have forgotten to initialize a command manager profile in your project. Please ensure the g_CmdManager->ProfileSetup() code is invoked in the same way as in Prof-UIS samples.
|
|