예제 #1
0
//
// This one can not be used because it gives the historically 
// to be activated document prior to the current action.
//
void CDocReactor::documentToBeActivated(AcApDocument* pDoc)
{
#ifndef NDEBUG
	acutPrintf("\ndocumentToBeActiveated: %s.", pDoc->fileName());
	acedPostCommandPrompt();
#endif
}
예제 #2
0
Adesk::Boolean
addMatchPoly()
{
    AcRxObject *pTemp;

    if (pTemp = acrxServiceDictionary->at("MatchProperties"))
    {
        acutPrintf ("MatchProperties is now available.\n"
                    "Now adding match prop protocol extension to AsdkPoly.\n");
        acedPostCommandPrompt();


        AcRxService *pSvc = AcRxService::cast(pTemp);

        if (pSvc == NULL)
            // something's terribly wrong so abort
            acrx_abort("\nProblem with service dictionary\n");

        // now to add the dependency to match.arx
        pSvc->addDependency();

        pMatchPoly = new AsdkPolyMatchProp;
        AsdkPoly::desc()->addX(AcDbMatchProperties::desc(), pMatchPoly);

        AppEventCatcher::thisAppLoaded = 1;

        return Adesk::kTrue;
    }

    return Adesk::kFalse;
}
예제 #3
0
// Called when a bubble notification is closed.  
// The return code indicates the close condition.  
// You can customize the pData argument to suit your needs as well.
void BubbleWindowCallback(void *pData,int nReturnCode)
{
    CString strMsg;
	switch(nReturnCode)
    {
    case AcTrayItemBubbleWindowControl::BUBBLE_WINDOW_ERROR_NO_CREATE:
        AfxMessageBox(_T("Couldn't Create the Bubble Window!"));
        break;
    case AcTrayItemBubbleWindowControl::BUBBLE_WINDOW_ERROR_NO_ICONS:
        AfxMessageBox(_T("No Tray Area for the Bubble Window!"));
        break;
    case AcTrayItemBubbleWindowControl::BUBBLE_WINDOW_ERROR_NO_NOTIFICATIONS:
        AfxMessageBox(_T("No Bubble Window Notifications!"));
        break;
    case AcTrayItemBubbleWindowControl::BUBBLE_WINDOW_CLOSE:
        acutPrintf(L"\nNotification Closed...\n");
		break;
    case AcTrayItemBubbleWindowControl::BUBBLE_WINDOW_TIME_OUT:
		acutPrintf(L"\nNotification Timed Out...\n");
        break;
    case AcTrayItemBubbleWindowControl::BUBBLE_WINDOW_HYPERLINK_CLICK:
        acutPrintf(L"\nHyperlink Selected...\n");
        break;
	}
	acedPostCommandPrompt();
}
예제 #4
0
/////////////////////////////////////////////////////////////////////////////////////
//
// document manager reactor
//
/////////////////////////////////////////////////////////////////////////////////////
//
//
//
void CDocReactor::documentActivated(AcApDocument* pDoc)
{
#ifndef NDEBUG
	acutPrintf("\ndocumentActiveated: %s.\n", pDoc->fileName());
	acedPostCommandPrompt();
#endif
	attachDbReactor(pDoc->database());
}
예제 #5
0
void CDocReactor::documentCreated(AcApDocument* pDoc)
{
#ifndef NDEBUG
	acutPrintf("\ndocumentCreated: %s.\n", pDoc->fileName());
	acedPostCommandPrompt();
#endif
	if(gpDlg)
		objDisplay("", NULL);
}
예제 #6
0
void MenuLMAMain::onCommand(Adesk::UInt32 cmdIndex)
{
    acDocManager->pushResourceHandle(_hdllInstance);

    CString str1;
    m_pMenu->GetMenuString(cmdIndex,str1,MF_BYCOMMAND);
    acedPostCommandPrompt();
    acDocManager->popResourceHandle();
}
예제 #7
0
//
// Obviously, we need to delete the database reactor associated
// with the destroyed doc.
//
void CDocReactor::documentToBeDestroyed(AcApDocument* pDoc)
{
#ifndef NDEBUG
	acutPrintf("\ndocumentToBeDestroyed: %s.\n", pDoc->fileName());
	acedPostCommandPrompt();
#endif
	detachDbReactor(pDoc->database());
	if(gpDlg)
		objDisplay("", NULL);
}
예제 #8
0
//
//
//	Detach the database reactor if the db is deactivated.  
//  Close the dialog if requested by the user.
//
//
void detachDbReactor(AcDbDatabase* pDb)
{
	acDocManager->lockDocument(curDoc(), AcAp::kWrite);
    if(gpDbReactor) 
    {
        pDb->removeReactor(gpDbReactor);
		delete gpDbReactor;
		gpDbReactor = NULL;
		acutPrintf("\nDetached DbReactor from the current database.\n");
    }
	acDocManager->unlockDocument(curDoc());

	acedPostCommandPrompt();
}
예제 #9
0
//
//	Attach the database reactor if one isn't attached already.  
//	Then, start up the dialog.
//
//
void attachDbReactor(AcDbDatabase* pDb)
{
	if(gbDisplayDialog)
	{
		AcDbDatabase* pWkDb = acdbHostApplicationServices()->workingDatabase();
		assert(pWkDb == pDb);
		AcDbDatabase* pCurDb = curDoc()->database();
		assert(pCurDb == pDb);
		acDocManager->lockDocument(curDoc(), AcAp::kWrite);
    
		gpDbReactor = new CDbModReactor();
		pWkDb->addReactor(gpDbReactor);
		acutPrintf("\nAttached CDbModReactor to the current database.\n");     
		
		acDocManager->unlockDocument(curDoc());
		acedPostCommandPrompt();
	}
	else
		endDlg();
}
예제 #10
0
void initModule()
{

    // add match prop protocol extension to AsdkPoly
    //
    if (!addMatchPoly())
    {
        acutPrintf ("MatchProperties has not been registered.\n"
                    "Protocol extension will be added when MATCHPROP is used\n");
        acedPostCommandPrompt();
    }

    acedRegCmds->addCommand("ASDK_POLYGON",
                            "ASDK_POLY",
                            "POLY",
                            ACRX_CMD_MODAL,
                            &polyCommand);

    acedRegCmds->addCommand("ASDK_POLYGON",
                            "ASDK_DRAGPOLY",
                            "DRAGPOLY",
                            ACRX_CMD_MODAL,
                            &dragPolyCommand);

    acedRegCmds->addCommand("ASDK_POLYGON",
                            "ASDK_POLYEDIT",
                            "POLYEDIT",
                            ACRX_CMD_MODAL | ACRX_CMD_USEPICKSET,
                            &polyeditCommand);

    acedRegCmds->addCommand("ASDK_POLYGON",
                            "ASDK_TRANSACT",
                            "TRANSACT",
                            ACRX_CMD_MODAL,
                            &transactCommand);

    acedRegCmds->addCommand("ASDK_POLYGON",
                            "ASDK_HILITPOLY",
                            "HILITPOLY",
                            ACRX_CMD_MODAL,
                            &hilitPoly);

    acedRegCmds->addCommand("ASDK_POLYGON",
                            "ASDK_HILITSOLID",
                            "HILITSOLID",
                            ACRX_CMD_MODAL,
                            &hilitSolid);

    acedRegCmds->addCommand("ASDK_POLYGON",
                            "ASDK_CREATEINSERT",
                            "CREATEINSERT",
                            ACRX_CMD_MODAL,
                            &createInsert);

    acedRegCmds->addCommand("ASDK_POLYGON",
                            "ASDK_HILITINSERT",
                            "HILITINSERT",
                            ACRX_CMD_MODAL,
                            &hilitInsert);

    acedRegCmds->addCommand("ASDK_POLYGON",
                            "ASDK_USEDRAGDATA",
                            "USEDRAGDATA",
                            ACRX_CMD_TRANSPARENT,
                            setUseDragData);
    UpdateUserInterfaceForPolySamp();
}