|
|
|
|
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 |
|
YS Jang
|
Jun 14, 2006 - 5:06 AM
|
Hi,
I want a Toolbar that is not Dock.
and, I used Funny bar in your library version 2.50
But, I have a Problem,
Sometimes, Toolbar is hide and display back color
=========================================== File view ........................... ----------------------------------------------------------------------------- (toolbar) -> Black color ----------------------------------------------------------------------------- view ----------------------------------------------------------------------------
What is wrong?
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
HICON hIcon = (::AfxGetApp())->LoadIcon(IDR_MAINFRAME);
ASSERT( hIcon != NULL );
SetIcon( hIcon, TRUE );
SetIcon( hIcon, FALSE );
CCreateContext _cc;
_cc.m_pCurrentDoc = NULL;
_cc.m_pCurrentFrame = this;
_cc.m_pLastView = NULL;
_cc.m_pNewDocTemplate = NULL;
_cc.m_pNewViewClass = RUNTIME_CLASS( CChildView );
CWnd * pWndView = CreateView( &_cc );
if( pWndView == NULL )
{
TRACE0("Failed to create view window\n");
return -1;
}
ASSERT_KINDOF( CChildView, pWndView );
m_pWndView =
STATIC_DOWNCAST( CChildView, pWndView );
SetActiveView( m_pWndView );
m_pWndView->ModifyStyleEx( WS_EX_CLIENTEDGE|WS_EX_STATICEDGE|WS_EX_DLGMODALFRAME, 0, SWP_FRAMECHANGED );
CWinApp * pApp = ::AfxGetApp();
ASSERT( pApp != NULL );
ASSERT( pApp->m_pszRegistryKey != NULL );
ASSERT( pApp->m_pszRegistryKey[0] != _T(’\0’) );
ASSERT( pApp->m_pszProfileName != NULL );
ASSERT( pApp->m_pszProfileName[0] != _T(’\0’) );
ASSERT( pApp->m_pszProfileName != NULL );
g_CmdManager->ProfileSetup(pApp->m_pszProfileName, GetSafeHwnd());
VERIFY( g_CmdManager->UpdateFromMenu( pApp->m_pszProfileName,IDR_MAINFRAME));
VERIFY( g_CmdManager->UpdateFromToolBar(pApp->m_pszProfileName,IDR_MAIN_TOOLBAR));//IDR_MAIN_TOOLBAR
if( !m_wndMenuBar.Create(NULL, this,IDR_MAINFRAME))
{
TRACE0("Failed to create menubar\n");
return -1; // failed to create
}
if( (! m_wndToolBar.Create(_T(""), this, IDR_MAIN_TOOLBAR))
|| (! m_wndToolBar.LoadToolBar(IDR_MAIN_TOOLBAR) ) )
{
TRACE0("Failed to create main toolbar\n");
return -1; // fail to create
}
|
|
Technical Support
|
Jun 14, 2006 - 9:50 AM
|
To make the toolbar non-dockable like the status bar, just do not call the EnableDocking() method of this toolbar. You should not also invoke the CFrameWnd::DockControlBar() method for it. The non-dockable toolbar will occupy an entire row/column in the main frame window just as the status bar does. The background of this toolbar will be consistent with the theme provided by the currently used paint manager. You should not see any black background in any case. The black background is provided by the CExtPainManagerOffice2007_R2_Obsidian paint manager, but it is available only with Prof-UIS 2.54. We need more details about the problem. Would you send us your project or a compiled version of your application?
|
|