
BCGControlBar教程:Outlook Bars
发布日期:2021-05-04 18:19:47
浏览次数:22
分类:精选文章
本文共 2388 字,大约阅读时间需要 7 分钟。
Library框架支持Outlook样式的快捷方式控制栏。 您可以使用这些栏来增强应用程序中的工作区管理。
快捷方式栏具有以下元素:
- 标题 - 显示当前选择的页面名称
- 带快捷按钮或嵌入式控件的页面
- 页面和页面按钮之间的拆分器
- 左侧有页面名称和图标的页面按钮
- 位于底部的工具栏,带有页面小图标和选项菜单
“outlook”控制条的功能由CBCGPOutlookBar类提供。 要使用此课程,请执行以下步骤:
- 将Outlook页面大图标列表添加到您的应用程序资源(建议的图标大小为24x24。例如,资源ID将为IDB_PAGES。
- 将Outlook页面小图标列表(将显示在位于底部的工具栏上)添加到您的应用程序资源(建议的图标大小为16x16)。 例如,资源ID将是IDB_PAGES_SMALL。
- 为每个快捷方式(IDI_SHORTCUT1,IDI_SHORTCUT1,...)准备图标。
- 将以下成员添加到您的CMainFrame类:
- CBCGPOutlookBar m_wndShortcutsBar;
- CBCGPOutlookBarPane m_wndShortcutsPane1;
- CBCGPOutlookBarPane m_wndShortcutsPane2;
- 通过以下方式初始化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);
发表评论
最新留言
第一次来,支持一个
[***.219.124.196]2025年04月14日 07时54分16秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
39. Combination Sum
2019-03-06
41. First Missing Positive
2019-03-06
80. Remove Duplicates from Sorted Array II
2019-03-06
83. Remove Duplicates from Sorted List
2019-03-06
410. Split Array Largest Sum
2019-03-06
开源项目在闲鱼、b 站上被倒卖?这是什么骚操作?
2019-03-06
Vue3发布半年我不学,摸鱼爽歪歪,哎~就是玩儿
2019-03-06
《实战java高并发程序设计》源码整理及读书笔记
2019-03-06
Java开源博客My-Blog(SpringBoot+Docker)系列文章
2019-03-06
程序员视角:鹿晗公布恋情是如何把微博搞炸的?
2019-03-06
【JavaScript】动态原型模式创建对象 ||为何不能用字面量创建原型对象?
2019-03-06
Linux应用-线程操作
2019-03-06
多态体验,和探索爷爷类指针的多态性
2019-03-06
系统编程-进程间通信-无名管道
2019-03-06
记2020年初对SimpleGUI源码的阅读成果
2019-03-06
C语言实现面向对象方法学的GLib、GObject-初体验
2019-03-06
系统编程-进程-ps命令、进程调度、优先级翻转、进程状态
2019-03-06
为什么我觉得需要熟悉vim使用,难道仅仅是为了耍酷?
2019-03-06