Exemplo n.º 1
0
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;
}
Exemplo n.º 2
0
void CMDITestDialog::OnIsquiescentButton() 
{
    AcApDocument *pDoc = acDocManager->curDocument();

    if(pDoc) {
        CString tempStr;
        tempStr.Format("Current Doc is %s\nlockMode() returned %s\nand myLockMode() returned %s.",
                        pDoc->isQuiescent() ? "Quiescent." : "NOT Quiescent.",
                        modeStr(pDoc->lockMode()),
                        modeStr(pDoc->myLockMode()) );
        AfxMessageBox( tempStr );
    }
}