[求助]无模式对话框如何获得光标?
<p>在arx中建立无模式对话框,运行后,需要先在autocad中进行选择等操作,再回到无模式对话框中进行输入操作,但无模式对话框无法获得光标,我知道有一个keepfocus函数,但无论是返回true还是false,都无法实现光标在autocad和无模式对话框中自由切换。这个问题该如何解决?有哪位能指点一下,非常感谢1</p> <p>看文档,</p><p>在你使用acedXXXXX的时候:</p><p>1.你的类必须继承于CAdUiXXXX</p><p>2.在使用acedXXXXX之前调用BeginEditorCommand()</p><p>3.在之后根据成功失败的情况调用CompleteEditorCommand()或CancelEditorCommand();</p><p>文档中有下面的论述:</p><ol><li class="list_1" value="4">Add the button handlers for picking a point and angle using the AutoCAD editor. The BeginEditorCommand(), CompleteEditorCommand(), and CancelEditorCommand() functions are used to hide the dialog, allow the call to acedGetPoint and acedGetAngle, and finally, either cancel or redisplay the dialog based on how the user picked: </li></ol><pre class="prog_indent_1">// AsdkAcUiDialogSample message handlers</pre><pre class="prog_indent_1">void AsdkAcUiDialogSample::OnButtonPoint() </pre><pre class="prog_indent_1">{</pre><pre class="prog_indent_1"> // Hide the dialog and give control to the editor</pre><pre class="prog_indent_1"> //</pre><pre class="prog_indent_1"> BeginEditorCommand();</pre><pre class="prog_indent_1"> ads_point pt;</pre><pre class="prog_indent_1"></pre><pre class="prog_indent_1"> // Get a point</pre><pre class="prog_indent_1"> //</pre><pre class="prog_indent_1"> if (acedGetPoint(NULL, "\nPick a point: ", pt) == RTNORM) {</pre><pre class="prog_indent_1"></pre><pre class="prog_indent_1"> // If the point is good, continue</pre><pre class="prog_indent_1"> //</pre><pre class="prog_indent_1"> CompleteEditorCommand();</pre><pre class="prog_indent_1"> m_strXPt.Format("%g", pt);</pre><pre class="prog_indent_1"> m_strYPt.Format("%g", pt);</pre><pre class="prog_indent_1"> m_strZPt.Format("%g", pt);</pre><pre class="prog_indent_1"> DisplayPoint();</pre><pre class="prog_indent_1"> } else {</pre><pre class="prog_indent_1"></pre><pre class="prog_indent_1"> // otherwise cancel the command (including the dialog)</pre><pre class="prog_indent_1"> CancelEditorCommand();</pre><pre class="prog_indent_1"> }</pre><pre class="prog_indent_1">}</pre> <div class="HeadingOverlayNew">CAdUiBaseDialog::BeginEditorCommand Function</div><p class="signature">void</p><p class="signature">BeginEditorCommand();</p><p>Call this method to indicate an AutoCAD interactive command is starting. </p><p>Example: </p><pre> BeginEditorCommand();
if (DoMyInteractiveCommand())
CompleteEditorCommand();
else
CancelEditorCommand();</pre>
页:
[1]