原創(chuàng)|其它|編輯:郝浩|2013-01-14 11:10:36.000|閱讀 970 次
概述:BCGControlBar Library框架支持Outlook風(fēng)格的快捷控制欄,可以在應(yīng)用程序中使用這些欄,以提高工作區(qū)的管理,而Outlook控件欄主要是由CBCGPOutlookBar類提供,如果想要使用這個類,可以按照下面的步驟來進行......
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
BCGControlBar Library框架支持Outlook風(fēng)格的快捷控制欄,可以在應(yīng)用程序中使用這些欄,以提高工作區(qū)的管理。
快捷欄主要包含以下的一些內(nèi)容:
Outlook控件欄主要是由CBCGPOutlookBar類提供,如果想要使用這個類,可以按照下面的步驟來進行:
1、添加outlook頁面大圖標(biāo)列到你的應(yīng)用程序源(建議的圖標(biāo)尺寸是24×24,比如說這個源ID將會是IDB_PAGES)。
2、添加Outlook小圖標(biāo)列(將會在位于底部的工具欄中顯示)到你的應(yīng)用程序源中(建議的尺寸是16×16),比如說源ID將會是IDB_PAGES_SMALL。
3、為每個快捷圖標(biāo)準(zhǔn)備圖標(biāo)(IDI_SHORTCUT1,IDI_SHORTCUT1,······)
4、添加以下成員到你的CMainFrame類:
(1)CBCGPOutlookBar m_wndShortcutsBar;
(2)CBCGPOutlookBarPane m_wndShortcutsPane1;
(3)CBCGPOutlookBarPane m_wndShortcutsPane2;
5、通過下面的方式用CMainFrame::OnCreate初始化快捷鍵:
CBCGPOutlookWnd::EnableAnimation (); const int nInitialWidth = 150; const CString strCaption = _T("Shortcuts"); m_wndShortcutsBar.SetMode2003(); if (!m_wndShortcutsBar.Create (strCaption, this, CRect (0, 0, nInitialWidth, nInitialWidth), ID_VIEW_OUTLOOKBAR, WS_CHILD | WS_VISIBLE | CBRS_LEFT)) { TRACE0("Failed to create outlook bar\n"); return FALSE; // fail to create } CBCGPOutlookWnd* pShortcutsBarContainer = DYNAMIC_DOWNCAST (CBCGPOutlookWnd, m_wndShortcutsBar.GetUnderlinedWindow ()); if (pShortcutsBarContainer == NULL) { TRACE0("Cannot get outlook bar container\n"); return FALSE; } pShortcutsBarContainer->SetImageList(IDB_PAGES, 24); pShortcutsBarContainer->SetToolbarImageList(IDB_PAGES_SMALL, 16); // Create first page: m_wndShortcutsPane1.Create (&m_wndShortcutsBar, dwDefaultToolbarStyle, ID_SHORTCUTS_PANE_1); m_wndShortcutsPane1.SetOwner (this); m_wndShortcutsPane1.EnableTextLabels (); m_wndShortcutsPane1.EnableDocking (CBRS_ALIGN_ANY); m_wndShortcutsPane1.AddButton (theApp.LoadIcon(IDI_SHORTCUT1), _T("Shortcut 1"), ID_SHORTCUT_1); m_wndShortcutsPane1.AddButton (theApp.LoadIcon(IDI_SHORTCUT2), _T("Shortcut 2"), ID_SHORTCUT_2); pShortcutsBarContainer->AddTab (&m_wndShortcutsPane1, _T("Page 1"), 0, FALSE); m_wndShortcutsPane1.EnableDocking (CBRS_ALIGN_ANY); // Create second page: m_wndShortcutsPane2.Create (&m_wndShortcutsBar, dwDefaultToolbarStyle, ID_SHORTCUTS_PANE_2); m_wndShortcutsPane2.SetOwner (this); m_wndShortcutsPane2.EnableTextLabels (); m_wndShortcutsPane2.EnableDocking (CBRS_ALIGN_ANY); m_wndShortcutsPane2.AddButton (theApp.LoadIcon(IDI_SHORTCUT3), _T("Shortcut 3"), ID_SHORTCUT_3); m_wndShortcutsPane2.AddButton (theApp.LoadIcon(IDI_SHORTCUT4), _T("Shortcut 4"), ID_SHORTCUT_4); pShortcutsBarContainer->AddTab (&m_wndShortcutsPane2, _T("Page 2"), 1, FALSE);
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都控件