三种类型的停靠窗口实现

要想在窗口上创建停靠窗口pane有如下方式: //变量定义:CXTPDockingPaneManager m_paneManager;

1. 添加视图到pane显示

Attach 视图
	CXTPDockingPane *pPane = m_paneManager.CreatePane(ID_PANE_INFO, rectMainFrame, xtpPaneDockRight);
	pPane->SetTitle("详细信息");
	pPane->AttachView(this, RUNTIME_CLASS(CONUMenuConfigView));

    

2. 添加CWnd控件到pane显示

Attach CWnd
               //变量类型              
           class CPropertyPane : public CWnd{...}
          CPropertyPane m_ALarmDictionary;

	m_Dictionary.Create(_T("STATIC"), NULL, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,             

                            CXTPEmptyRect(), this, 0);    //用户自己创建的CWND控件一定要用系统自带的名称:STATIC BUTTON

	CXTPDockingPane* pPane = m_paneManager.CreatePane(ID_PANE_DICTIONARY, 
                                           CRect(0, 0, 260, 500), xtpPaneDockRight);
	pPane->SetTitle(AnmsGetSentence(IDS_ALARM_DETAILED_INFO));
	pPane->Close();
	pPane->Attach(&m_Dictionary);


 

3. 添加Frame到pane显示

Attach Frame
	CXTPDockingPane *pPane= m_paneManager.CreatePane(IDD_USERSET_PANE, CRect(0, 0, 260, 500), xtpPaneDockRight);
	m_pUserPane= (CUserSetPaneFrame*)(RUNTIME_CLASS(CUserSetPaneFrame)->CreateObject());
	m_pUserPane->Create(NULL, NULL, WS_CHILD | WS_VISIBLE & (~WS_EX_DLGMODALFRAME), CXTPEmptyRect(), this, 0);
	m_pUserPane->SetParentViewWnd(pView->GetSafeHwnd());
	pPane->SetTitle(AnmsGetSentence(310119));
	pPane->SetMinTrackSize(CSize(400, 500));
	pPane->Attach(m_pUserSetPane);


注明:CXTPDockingPaneManager m_paneManager使用时一定调用如下函数,否则无法正常使用。

           m_paneManager.InstallDockingPanes(this);



 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值