当前位置: 首页>>代码示例>>C++>>正文


C++ CFunctionEditorDoc::GetFirstViewPosition方法代码示例

本文整理汇总了C++中CFunctionEditorDoc::GetFirstViewPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ CFunctionEditorDoc::GetFirstViewPosition方法的具体用法?C++ CFunctionEditorDoc::GetFirstViewPosition怎么用?C++ CFunctionEditorDoc::GetFirstViewPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CFunctionEditorDoc的用法示例。


在下文中一共展示了CFunctionEditorDoc::GetFirstViewPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: podGetFileViewPtr

CFileView* CGlobalObj::podGetFileViewPtr()
{
    CFileView* pFileView = nullptr;
    CView* pTempView = nullptr;
    BOOL bFound = FALSE;
    //Get the active document and find the CFileView attached to it
    CFunctionEditorDoc* pDoc = podGetFunctionEditorDoc();
    if (pDoc != nullptr)
    {
        POSITION pos = pDoc->GetFirstViewPosition();
        while (pos && !bFound)
        {
            pTempView = pDoc->GetNextView(pos);
            if (pTempView->IsKindOf(RUNTIME_CLASS(CFileView)))
            {
                pFileView = (CFileView*)pTempView;
                bFound = TRUE;
            }
        }
    }
    return pFileView;
}
开发者ID:Jason45degree,项目名称:busmaster,代码行数:22,代码来源:GlobalObj.cpp

示例2: OnDbClick

void COutWnd::OnDbClick()
{
    INT nSelectIndex;
    CString omStrSelectedItem;
    nSelectIndex = m_omListBox.GetCurSel();
    if(nSelectIndex!=LB_ERR )
    {
        CString omStrLineNumber = "";
        INT     nIndex          = 0;
        UINT    unLineNumber    = 0;
        char*   pcStopStr       = nullptr;

        m_omListBox.GetText(nSelectIndex,omStrSelectedItem);
        CString omStrFilePath;
        CString omStrFileName;
        omStrFilePath=omStrSelectedItem;
        while(!(nSelectIndex==0||omStrFilePath==defSTR_BUILD_TRACE_LINE_MARK))
        {
            --nSelectIndex;
            m_omListBox.GetText(nSelectIndex,omStrFilePath);
        }
        if(omStrFilePath==defSTR_BUILD_TRACE_LINE_MARK)
        {
            ++nSelectIndex;
            m_omListBox.GetText(nSelectIndex,omStrFilePath);
            int nNameIndex = omStrFilePath.ReverseFind('\\');
            if(nNameIndex != -1)
            {
                //pGetBusSpecificFunctionEditorDoc(omStrFilePath);
                CFunctionEditorDoc* pDoc = m_pGlobalObj->pGetDocPtrOfFile(omStrFilePath);
                if (pDoc != nullptr)
                {
                    //If file is opened then get its frame and activate it
                    {
                        POSITION pos = pDoc->GetFirstViewPosition();
                        if (pos)
                        {
                            pDoc->GetNextView(pos)->GetParentFrame()->ActivateFrame();
                        }
                    }
                }
                else
                {
                    //If file is not opened then open it
                    if ( !m_pGlobalObj->bOpenFunctioneditorfile(omStrFilePath) )
                    {
                        AfxMessageBox("Specified filename not found!",
                                      MB_OK|MB_ICONINFORMATION);
                    }
                }

                // Find the ':' to get the number after second ':'
                nIndex = omStrSelectedItem.Find(":");
                if(nIndex!=-1)
                {

                    omStrLineNumber = omStrSelectedItem.Right(
                                          omStrSelectedItem.GetLength()-nIndex-1);
                    nIndex          = omStrLineNumber.Find(":");
                    omStrLineNumber = omStrLineNumber.Right(
                                          omStrLineNumber.GetLength()-nIndex-1);

                    omStrLineNumber.TrimLeft();
                    omStrLineNumber.TrimRight();
                    omStrLineNumber = omStrLineNumber.SpanExcluding(":");
                    unLineNumber    = _tcstol((LPCTSTR)omStrLineNumber,
                                              &pcStopStr,10);
                    // Call this function only if the  line number is valid
                    if(unLineNumber!=0)
                    {
                        CFileView* pFileView = m_pGlobalObj->podGetFileViewPtr();
                        if(pFileView != nullptr)
                        {
                            pFileView->vDisplayWarningLineNumber(OUTWND,unLineNumber);
                        }
                    }
                }
                else
                {
                    nIndex = omStrSelectedItem.Find(":");
                    if(nIndex!=-1)
                    {
                        nIndex          = omStrSelectedItem.Find(":");
                        omStrLineNumber = omStrSelectedItem.Right(
                                              omStrSelectedItem.GetLength()-nIndex-1);

                        omStrLineNumber.TrimLeft();
                        omStrLineNumber.TrimRight();
                        omStrLineNumber = omStrLineNumber.
                                          SpanExcluding("\t ");
                        unLineNumber    = _tcstol((LPCTSTR)omStrLineNumber,
                                                  &pcStopStr,
                                                  10);
                        if(unLineNumber!=0)
                        {
                            CFileView* pFileView = m_pGlobalObj->podGetFileViewPtr();

                            if(nullptr != pFileView)
                            {
                                pFileView->vDisplayWarningLineNumber(OUTWND,
//.........这里部分代码省略.........
开发者ID:IXXAT-wucherer,项目名称:busmaster,代码行数:101,代码来源:OutWnd.cpp


注:本文中的CFunctionEditorDoc::GetFirstViewPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。