明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2258|回复: 2

[求助]无模式对话框如何获得光标?

[复制链接]
发表于 2007-1-1 11:11:00 | 显示全部楼层 |阅读模式

在arx中建立无模式对话框,运行后,需要先在AutoCAD中进行选择等操作,再回到无模式对话框中进行输入操作,但无模式对话框无法获得光标,我知道有一个keepfocus函数,但无论是返回true还是false,都无法实现光标在autocad和无模式对话框中自由切换。这个问题该如何解决?有哪位能指点一下,非常感谢1

发表于 2007-1-13 11:56:00 | 显示全部楼层

看文档,

在你使用acedXXXXX的时候:

1.你的类必须继承于CAdUiXXXX

2.在使用acedXXXXX之前调用BeginEditorCommand()

3.在之后根据成功失败的情况调用CompleteEditorCommand()或CancelEditorCommand();

文档中有下面的论述:

  1. 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:
// AsdkAcUiDialogSample message handlers
void AsdkAcUiDialogSample::OnButtonPoint() 
{
    // Hide the dialog and give control to the editor
    //
    BeginEditorCommand();
    ads_point pt;
    // Get a point
    //
    if (acedGetPoint(NULL, "\nPick a point: ", pt) == RTNORM) {
        // If the point is good, continue
        //
        CompleteEditorCommand();
        m_strXPt.Format("%g", pt[X]);
        m_strYPt.Format("%g", pt[Y]);
        m_strZPt.Format("%g", pt[Z]);
        DisplayPoint();
    } else {
        // otherwise cancel the command (including the dialog)
        CancelEditorCommand();
    }
}
发表于 2007-1-13 11:58:00 | 显示全部楼层
CAdUiBaseDialog::BeginEditorCommand Function

void

BeginEditorCommand();

Call this method to indicate an AutoCAD interactive command is starting.

Example:

    BeginEditorCommand();
    if (DoMyInteractiveCommand())
        CompleteEditorCommand();
    else
        CancelEditorCommand();
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-25 21:16 , Processed in 0.152728 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表