本文整理汇总了C++中SWindow::GetContainer方法的典型用法代码示例。如果您正苦于以下问题:C++ SWindow::GetContainer方法的具体用法?C++ SWindow::GetContainer怎么用?C++ SWindow::GetContainer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SWindow
的用法示例。
在下文中一共展示了SWindow::GetContainer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnBtnFileTypes
void CFolderHander::OnBtnFileTypes(EventArgs *pEvt)
{
SWindow *pBtn = sobj_cast<SWindow>(pEvt->sender);
CRect rcBtn = pBtn->GetWindowRect();
HWND hWnd = pBtn->GetContainer()->GetHostHwnd();
::ClientToScreen(hWnd,(LPPOINT)&rcBtn);
::ClientToScreen(hWnd,(LPPOINT)&rcBtn+1);
SMenu menu;
menu.LoadMenu(_T("menu_filetype"),_T("xml"));
for(int i=0;i<(int)m_lstLangExts.GetCount();i++)
{
SStringW strDesc = m_lstLangExts[i].strLang+L":"+m_lstLangExts[i].strExts;
menu.InsertMenu(i,MF_BYPOSITION,i+10,S_CW2T(strDesc),-1);
}
int id = menu.TrackPopupMenu(TPM_RIGHTALIGN|TPM_RETURNCMD,rcBtn.right,rcBtn.bottom,hWnd);
if(id!=0)
{
id-=10;
SEdit *pEdit = m_pFolderRoot->FindChildByName2<SEdit>(L"edit_filetypes");
SASSERT(pEdit);
if(pEdit->GetWindowTextLength()!=0)
{
pEdit->SetSel((DWORD)-1);
pEdit->ReplaceSel(L";");
}
pEdit->SetSel((DWORD)-1);
pEdit->ReplaceSel(m_lstLangExts[id].strExts);
}
}
示例2: Draw
RECT SCaret::Draw(IRenderTarget *pRT,int x, int y,BOOL bErase)
{
SWindow * pOwner = SWindowMgr::GetWindow(m_owner);
SASSERT(pOwner);
SASSERT(pOwner->IsFocusable());
CAutoRefPtr<IRenderTarget> pRTCaret;
GETRENDERFACTORY->CreateRenderTarget(&pRTCaret,0,0);
pRTCaret->SelectObject(m_bmpCaret);
CSize szCaret = m_bmpCaret->Size();
CRect rcCaret(CPoint(x,y),szCaret);
CRect rcWnd = pOwner->GetClientRect();
SWindow *pWnd = pOwner->GetParent();
while(pWnd)
{
CRect rcLimit = pWnd->GetClientRect();
rcWnd = rcWnd & rcLimit;
pWnd = pWnd->GetParent();
}
pOwner->GetContainer()->FrameToHost(rcWnd);
CRect rcCaretShow = rcCaret & rcWnd;
pRT->BitBlt(&rcCaretShow,pRTCaret,rcCaretShow.left - rcCaret.left,rcCaretShow.top - rcCaret.top,DSTINVERT);
return rcCaretShow;
}