ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

about modeless dialog used in autocad

5 REPLIES 5
Reply
Message 1 of 6
421232206
536 Views, 5 Replies

about modeless dialog used in autocad

in the attachments, there is a video about my problem. it is not easy to express, so I recorded this video. 

in the video, you can find that, the dialog in the bottom of the CAD frame, is a modeless dialog.  First, I select a line in the viewport, then I click a button in this dialog,  I guess now the focus is on this dialog. then I double click the item of the listview in the dialog. I intened to position a line in the viewport,  you can see, I have zoomed to the line, in  my code, I have selected the line,too.

    void MakeEntsSelected(ads_name ssName)
    {
        acedSSSetFirst( NULL , NULL );
        int es=acedSSSetFirst(ssName,NULL);
    }

 the function above is the code used to make entities selected by code.   but you can see that ,only if  I clicked the viewport, then the entities show selected. it seems that the viewport do not get focus. I have used functions like ,

    actrTransactionManager->flushGraphics();
    acedUpdateDisplay(); 

but it does not work.

Technology change world! Coding change technology! We coders are coding!
5 REPLIES 5
Message 2 of 6
owenwengerd
in reply to: 421232206

I what context is your MakeEntsSelected() function executing? It should be in a document context command handler. In some cases, it might work outside the document context if you set focus to the document window then send a WM_MOUSEACTIVATE message:

PostMessage( hwndDoc, WM_MOUSEACTIVATE, 0, MAKELPARAM(HTCLIENT,WM_LBUTTONDOWN) );

 

--
Owen Wengerd
ManuSoft
Message 3 of 6
421232206
in reply to: owenwengerd

like this,     PostMessage( curDoc(), WM_MOUSEACTIVATE, 0, MAKELPARAM(HTCLIENT,WM_LBUTTONDOWN) );

but it can not be compiled and error come out,

error C2660: “CWnd::PostMessageW” do not accept four parameters.

I am sure that MakeEntsSelected() has been executed.

Technology change world! Coding change technology! We coders are coding!
Message 4 of 6
owenwengerd
in reply to: 421232206

If you want to call CWnd:: PostMessage(), you'll need to change the arguments accordingly.

--
Owen Wengerd
ManuSoft
Message 5 of 6
421232206
in reply to: owenwengerd

//position a feature.
void CFeaturePropDlg::OnBnClickedBtnPosFeature()
{
    CMineFeature* pMF = GetCurrentMineFeatureProp();
    if (NULL == pMF) return;

    PosFeature(pMF);

    //PostMessage( curDoc(), WM_MOUSEACTIVATE, 0, MAKELPARAM(HTCLIENT,WM_LBUTTONDOWN) );
    acedGetAcadDwgView()->SendMessage(WM_MOUSEACTIVATE, 0, MAKELPARAM(HTCLIENT,WM_LBUTTONDOWN));
}

above is the fuction. I used acedGetAcadDwgView(), but it still does not work.  only when I click the viewport, then the selected entities show.

Technology change world! Coding change technology! We coders are coding!
Message 6 of 6
owenwengerd
in reply to: 421232206

You need to first set focus to the window, and post the message instead of sending. As I said, I don't know if that will work in your case, but it does work in some cases.

--
Owen Wengerd
ManuSoft

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost