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


C++ AcApDocument::docTitle方法代码示例

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


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

示例1: onAcadUpdateDialog

LRESULT CMDITestDialog::onAcadUpdateDialog( WPARAM, LPARAM )
{
    // update elements of the dialog to reflect the current
    // state of the documents

    // get the current number of documents
    m_staticDocNum.SetWindowText( getDocCount() );

    // check/uncheck document activation
    m_activationCheck.SetCheck( acDocManager->isDocumentActivationEnabled() );

    // set the current document fields
    CString fName;
    AcApDocument *pCurrDoc = acDocManager->curDocument();
    if( pCurrDoc ) {
        fName = pCurrDoc->docTitle();
        m_staticCurrentDoc.SetWindowText(fName);
        m_staticToBeCurrDoc.SetWindowText(fName);
        m_staticCurDocLockStatus.SetWindowText( modeStr(pCurrDoc->lockMode()) );
        m_staticCurDocMyLockStatus.SetWindowText( modeStr(pCurrDoc->myLockMode()) );
    }
    else {
        m_staticCurrentDoc.SetWindowText(fName);
        m_staticToBeCurrDoc.SetWindowText("");
        m_staticCurDocLockStatus.SetWindowText("");
        m_staticCurDocMyLockStatus.SetWindowText("");
    }

    // set the active document data
    AcApDocument *pActDoc = acDocManager->mdiActiveDocument();

    if( pActDoc ) {
        // active document name
        fName = pActDoc->docTitle();
        m_staticActiveDoc.SetWindowText(fName);
        // active document lock modes
        m_staticActDocLockStatus.SetWindowText( modeStr(pActDoc->lockMode()) );
        m_staticActDocMyLockStatus.SetWindowText( modeStr(pActDoc->myLockMode()) );
    }
    else {
        m_staticActiveDoc.SetWindowText("");
        m_staticActDocLockStatus.SetWindowText("");
        m_staticActDocMyLockStatus.SetWindowText("");
    }

    // rebuild listbox
    RebuildListBox();
	return TRUE;
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:49,代码来源:mditestdialog.cpp

示例2: getDocFromFilename

// getDocFromFilename()
//  Passed a filename, it finds the corresponding document pointer
//  Returns true if successful
bool CMDITestDialog::getDocFromFilename(CString csFileName, AcApDocument* &pNewDocument)
{
    // Iterate over the open documents. We will match the filename if:
    //      The filename specified matches the fully qualified path
    //      name, as returned by AcApDocument::filename()
    //      -or-
    //      The filename specified matches the filename portion of the 
    //      document name

    AcApDocumentIterator* iter = acDocManager->newAcApDocumentIterator();
    AcApDocument* pThisDocument = NULL;
    CString csThisFilename;
    CString csThisFilenameShort;

    csFileName.MakeUpper(); // uppercase comparisons

    while(!iter->done()) {   // Tiptoe through the tulips
        pThisDocument = iter->document();
        csThisFilename = pThisDocument->docTitle();
        csThisFilename.MakeUpper();
        csThisFilenameShort = csThisFilename.Right(csThisFilename.GetLength() -
            csThisFilename.ReverseFind('\\') - 1);

        if(csFileName == csThisFilename ||       // Full path match
            csFileName == csThisFilenameShort || // Matches filename only
            csFileName == csThisFilenameShort.Left( // Filename less extension
                          csThisFilenameShort.GetLength() - 4)) 
        {
            pNewDocument = pThisDocument;
            if( iter )
                delete iter;
            return true;
        }
        iter->step();
    }

    pNewDocument = NULL;
    if( iter )
        delete iter;
    // no match found 
    return false;
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:45,代码来源:mditestdialog.cpp

示例3: RebuildListBox

void CMDITestDialog::RebuildListBox()
{
    m_docListBox.ResetContent(); // start from an empty list box

    // at this moment, get all drawing names and add them to the list box.
    AcApDocumentIterator* iter = acDocManager->newAcApDocumentIterator();
    AcApDocument* pDoc = NULL;
    CString csFilename;

    while(!iter->done()) {   
        pDoc = iter->document();
        if(pDoc) {                     // #### make sure pDoc is not NULL ####
            csFilename = pDoc->docTitle(); 
            m_docListBox.AddString( csFilename );
        }
        iter->step();
    }
    if( iter )
        delete iter;
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:20,代码来源:mditestdialog.cpp


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