olegog 发表于 2016-2-3 02:11:24

对于无模式对话框,您需要覆盖 MSWWindowProc 并处理WM_ACAD_KEEPFOCUS messagevirtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);。
WXLRESULT WxArxTestDlg::MSWWindowProc( WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam )。
{。
开关(nMsg)。
{。
案例WM_ACAD_KEEPFOCUS:。
返回 TRUE;。
}。
return wxDialog::MSWWindowProc(nMsg, wParam, lParam);。
}。

olegog 发表于 2016-2-3 02:22:19

WxUserInteraction类是一个帮助类,用于隐藏模态对话框,以便您可以与编辑器进行交互
{
HWND m_activeWindow
std::vector
m_ wnds
公共:
WxUserInteraction()
WxUserInteraction(AcApDocument*pdDocument,bool提示)
虚拟~WxUserInteraction(无效)
受保护:
无效用户交互(AcApDocument*pDocument,bool提示)
void undoUserInteraction()
}
WxUserInteraction::WxUserInteraction()
{
用户交互(acDocManagerPtr()->curDocument(),true)
}
WxUserInteraction::WxUserInteraction(AcApDocument*pdDocument,bool提示)
{
用户交互(pDocument,提示)
}
WxUserInteraction::~WxUserInteraction(void)
{
undoUserInteraction()
}
void WxUserInteraction::用户交互(AcApDocument*pDocument,bool提示)
{
AcApDocManager*pDocMan=acdocmanager()
如果(pDocMan->curDocument()==pDocument)
{
pDocMan->禁用文档激活()
如果(!提示)
返回
HWND-hwMainWnd=adsw_acadMainWnd()
如果(::IsWindowEnabled(hwMainWnd)=TRUE)
返回
m_activeWindow=GetFocus()
for(HWND window=::GetActiveWindow();窗户!=无效的;window=::GetWindow(window,GW_OWNER))
{
如果(窗口==hwMainWnd)
中断
m_wnds.push_back(窗口)
}
::启用窗口(hwMainWnd,TRUE)
::设置焦点(hwMainWnd)
对于(size_t idx=0;idx
{
:显示窗口(m_wnds,SW_HIDE)
}
}
}
<div>void WxUserInteraction::UndoUserInteractions()</div>
{
acDocManagerPtr()->enableDocumentActivation()
如果(m_wnds.size()>0)
{
对于(std::vector
::reverse_iterator it=m_wnds.rbegin();它!=m_ wnds。rend()++it)
{
::ShowWindow(*it,SW_SHOW)
}
::启用窗口(adsw_acadMainWnd(),FALSE)
<div>:设置焦点(m_activeWindow)
}
}
示例
无效WxArxTestDlg::OnButtonClick(wxCommandEvent&event)
{
WxUserInteraction
AcGePoint3d pnt
ads_name name={0L,0L}
if(acedEntSel(_T(“\n选择实体”),name,asDblArray(pnt))==RTNORM)
{

}
事件.跳过()
}

olegog 发表于 2016-2-3 02:27:37

接下来,我将使用对话框创建一个示例,http://www.dialogblocks.com/

olegog 发表于 2016-2-3 05:35:31

请参见http://docs.wxwidgets.org/3.0/overview_xrc.html   。


简单对话框。

wx vertical。


1个选项。
wx all | wx expand。
10个。





单击。

wxRIGHT。
10个。



确定。

wxLEFT。
10个。

横向的。

wx all | wx align _ CENTRE。
10个。




   in On _ kinitapmsg   wxXmlResource::Get()--> Load(" C:\ \ Temp \ \ resource . xrc ");。
       静态void wxrx project _ wx test 6(void)。
{。
wx window * win = WxRxApp::main window();。
if (win)。
{。
wxDialog dlg。
if(wxXmlResource::Get()-> load dialog(& DLG,win," SimpleDialog"))。
dlg,show modal();。
}。
}。
页: 1 [2]
查看完整版本: wxWidgets和Brx/Arx