protected: // control bar embedded members
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
CTrueColorToolBar m_ToolBarDrawLeft;
CTrueColorToolBar m_ToolBarDrawRight;
/
m_ToolBarDrawLeft.SetBorders(1, 1, 1, 1);
if (!m_ToolBarDrawLeft.Create(this, WS_CHILD | WS_VISIBLE | CBRS_LEFT
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_ToolBarDrawLeft.LoadToolBar(IDR_TOOLBAR_DRAW))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
m_ToolBarDrawLeft.ModifyStyle(0, TBSTYLE_FLAT);
m_ToolBarDrawLeft.LoadTrueColorToolBar(TOOLBAR_DRAW_BUTTON_WIDTH,
IDB_TOOLBAR_DRAW,
IDB_TOOLBAR_DRAW_HOT,
IDB_TOOLBAR_DRAW_DISABLED);
m_ToolBarDrawRight.SetBorders(1, 1, 1, 1);
if (!m_ToolBarDrawRight.Create(this, WS_CHILD | WS_VISIBLE | CBRS_RIGHT
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_ToolBarDrawRight.LoadToolBar(IDR_TOOLBAR_DRAW))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
m_ToolBarDrawRight.ModifyStyle(0, TBSTYLE_FLAT);
m_ToolBarDrawRight.LoadTrueColorToolBar(TOOLBAR_DRAW_BUTTON_WIDTH,
IDB_TOOLBAR_DRAW,
IDB_TOOLBAR_DRAW_HOT);
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
}
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
m_ToolBarDrawLeft.EnableDocking(CBRS_ALIGN_ANY);
m_ToolBarDrawRight.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
DockControlBar(&m_ToolBarDrawLeft);
DockControlBar(&m_ToolBarDrawRight);
return 0;
}
CTrueColorToolBar
最新推荐文章于 2022-01-07 15:16:23 发布