本文整理汇总了C++中CChildFrame::DrawTabs方法的典型用法代码示例。如果您正苦于以下问题:C++ CChildFrame::DrawTabs方法的具体用法?C++ CChildFrame::DrawTabs怎么用?C++ CChildFrame::DrawTabs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChildFrame
的用法示例。
在下文中一共展示了CChildFrame::DrawTabs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateTabs
// generates the string list of view names to be used for the tabs
void CBonfireDoc::UpdateTabs(LPCTSTR lpszPathName /*= NULL*/)
{
CStringList pTabList;
CString ext = (lpszPathName == NULL)
? GetFileExtension(GetPathName())
: GetFileExtension(lpszPathName);
// generate tabs based on the file extension
CString strViews = theApp.m_opOptions.views.vAssociations[0].strViews; // init to default views
CString strExtList = "";
size_t nExt = theApp.m_opOptions.views.vAssociations.size();
// see if the current file's extension is in the list
while (nExt-- > 0) // 0 is the default file extension
{
strExtList = (CString)theApp.m_opOptions.views.vAssociations[nExt].strExtensions;
strExtList.Remove(' ');
if (IsStringPresent(strExtList, ext))
{
strViews = theApp.m_opOptions.views.vAssociations[nExt].strViews;
break;
}
}
POSITION pos = GetFirstViewPosition();
CChildFrame* pChild = ((CChildFrame*)GetNextView(pos)->GetParentFrame());
CView* pView = pChild->GetActiveView();
BOOL bIsCurViewAvail = FALSE;
// also make sure the current view is available, if not, close it
// add the tabs to the tablist
for (int i = 0; i < theApp.m_arAllViews.GetSize(); i++)
{
if (strViews[i] != '-')
{
pTabList.AddHead( ((CBonfireView*)theApp.m_arAllViews[i])->m_strCaption );
if (pView && pView->IsKindOf(theApp.m_arAllViews[i]->m_pClass))
bIsCurViewAvail = TRUE;
}
}
// draw the tabs
pChild->DrawTabs(&pTabList);
if (!pView || !bIsCurViewAvail)
SwitchToFirstView();
}