Hey all.
I tried your brrof-UI 2.25 and it looked great from the demos. However when i tried to implement the UI into my program using the article provided, the toolbar buttons refused to display. I can select the enabled icons but there is no picture. Is there some code i’m forgetting to add?
Source:
// MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "LP.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CMainFrame
IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
ON_WM_CREATE()
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
// CMainFrame construction/destruction
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
g_PaintManager.InstallPaintManager( RUNTIME_CLASS(CExtPaintManagerOffice2003) );
}
CMainFrame::~CMainFrame()
{
}
static UINT g_statBasicCommands[] =
{
ID_APP_ABOUT,
ID_APP_EXIT,
ID_FILE_NEW,
ID_VIEW_TOOLBAR,
ID_VIEW_STATUS_BAR,
ID_EDIT_COPY,
ID_EDIT_CUT,
ID_EDIT_PASTE,
ID_WINDOW_CASCADE,
ID_WINDOW_TILE_HORZ,
0, // end of list
};
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndMenuBar.Create(
NULL, // _T("Menu Bar"),
this
))
{
TRACE0("Failed to create menubar\n");
return -1;
}
if( !m_wndToolBar.Create(
_T( "Toolbar name" ),
this,
AFX_IDW_TOOLBAR
)
|| !m_wndToolBar.LoadToolBar( IDR_MAINFRAME )
)
{
TRACE0( "Failed to create toolbar" );
return -1;
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
if( !CExtControlBar::FrameEnableDocking(this) )
{
ASSERT( FALSE );
return -1;
}
// Enable Docking
m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
// Docking Related
DockControlBar(&m_wndMenuBar);
DockControlBar(&m_wndToolBar);
RecalcLayout();
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return TRUE;
}
BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
if( m_wndMenuBar.TranslateMainFrameMessage(pMsg) )
return TRUE;
return CFrameWnd::PreTranslateMessage(pMsg);
}
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CMDIFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CMDIFrameWnd::Dump(dc);
}
#endif //_DEBUG
// CMainFrame message handlers