编程开源技术交流,分享技术与知识

网站首页 > 开源技术 正文

Xtreme Toolkit Pro工具栏使用教程

wxchong 2024-07-15 09:50:38 开源技术 54 ℃ 0 评论

Xtreme Toolkit Pro是MFC开发中最全面界面控件套包,它提供了Windows开发所需要的11种主流的Visual C++ MFC控件,包括Command Bars、Controls、Chart Pro、Calendar、Docking Pane、Property Grid、Report Control、Shortcut Bar、Syntax Edit、Skin Framework 和Task Panel。前往慧都网获取更多免费Xtreme Toolkit Pro教程、视频、示例!

关于停靠工具栏有很多文章。但是,我觉得在Microsoft的MSDN站点上找到相同的信息这很重要简而言之...

将以下方法添加到您的CMainFrame类中:


void CMainFrame::DockControlBarLeftOf(
                        CToolBar* Bar, CToolBar* LeftOf)
{
    CRect rect;
    DWORD dw;
    UINT n;

    // get MFC to adjust the dimensions of all docked ToolBars
    // so that GetWindowRect will be accurate
    RecalcLayout(TRUE);

    LeftOf->GetWindowRect(&rect);
    rect.OffsetRect(1,0);
    dw=LeftOf->GetBarStyle();
    n = 0;
    n = (dw&CBRS_ALIGN_TOP) ? AFX_IDW_DOCKBAR_TOP : n;
    n = (dw&CBRS_ALIGN_BOTTOM && n==0) ?
                                AFX_IDW_DOCKBAR_BOTTOM : n;
    n = (dw&CBRS_ALIGN_LEFT && n==0) ?
                                AFX_IDW_DOCKBAR_LEFT : n;
    n = (dw&CBRS_ALIGN_RIGHT && n==0) ?
                                AFX_IDW_DOCKBAR_RIGHT : n;

    // When we take the default parameters on rect, DockControlBar
    // will dock each Toolbar on a seperate line. By calculating a
    // rectangle, we are simulating a Toolbar being dragged to that
    // location and docked.
    DockControlBar(Bar,n,&rect);
}

现在,在您的CMainFrame :: OnCreate中,而不是使用DockControlBar,请使用DockControlBarLeftOf:

m_wndToolBar1.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar2.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar1);
DockControlBarLeftOf(&m_wndToolBar2,&m_wndToolBar1);

这将停靠m_wndToolBar1左侧的m_wndToolBar2。点击获取文章对应示例Demo。

今天的内容就是这些了,下载最新版Xtreme ToolKit Pro并在下方评论区分享您对该产品的想法。您的反馈意见可帮助我们在以后的更新中找到正确的方向。

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表